xyz It doesnt work...
When i have an image he asks me for a texture, when a texture he asks me for an image...

xyz Texture object returned by the loading function as if it was an Image object

The only reason i did that way was because the engine forced me into it, in previous errors...

If its so easy for you, then why dont you make a working example without for loops or extras functions, just a simple 2 sprites/or draw textures combined into 1 image... You keep arguing, and deviating into other subjects, but you are the one that doesnt trow any examples.

  • xyz replied to this.

    jonSS @Toxe posted working example of exactly what you're asking for, even put the thing on github.

    jonSS You keep arguing, and deviating into other subjects, but you are the one that doesnt trow any examples.

    This is a discussion forum, not example throwing forum. No one is entitled to getting code gifts here and you won't solicit any by being arrogant. All things I mentioned are relevant for the problem you have.

    jonSS What I don't really understand is why you want to draw the image/texture yourself in _draw()? Why not just create a sprite, drop it into the scene and be done with it, like in my code snippet above? That way you don't need to worry about anything like (re)drawing and the engine handles everything for you.

    Also did you try cloning and running my example project? If I did understand you correctly it should do everything that you needed.

    jonSS blit/blend is massive pile of st

    I don't know, I found it pretty simple and straightforward. The Image class documentation exposed everything that was needed and was pretty concise. But I have done stuff like this in other languages/libraries/systems before so I knew what to look for and everything was basically as I expected it to be.

    • xyz replied to this.

      Toxe What I don't really understand is why you want to draw the image/texture yourself in _draw()? Why not just create a sprite, drop it into the scene and be done with it, like in my code snippet above? That way you don't need to worry about anything like (re)drawing and the engine handles everything for you.

      The OP is working on a sort of a custom tilemap plugin with the idea to implement pre process effects like blur on whole tile layers. Imho, judging from the several questions asked so far, they're approaching the whole thing in a bit of a misguided way, and also trying to bite off more than they can chew with their current level of technical knowledge. So it's all bound to periodically get stuck with an odd xy problem like this one. I tried to point this out on several occasions, but they're being stubborn 😃 Which is ok as long as one is ready to invest some of that stubborn persistency into learning how things actually work.

        I have it working... dont know for witch reason it started to work now ? i though it was a problem with godot v4.2.1

        extends Sprite2D
        
        var absRect = Rect2(0, 0, 32*3, 32*3 );
        var absRect2 = Rect2(32*5, 32*5, 32*3, 32*3 );
        var texture1;
        
        func _ready() -> void:
        	
        	var img1 = ImageTexture.create_from_image(texture.get_image().get_region( absRect ) );
        	var img2 = ImageTexture.create_from_image(texture.get_image().get_region( absRect2 ) );
        	
        	var format = img1.get_image().get_format()
        	var image1 = Image.create(500, 500, false, format)
        	
        	image1.blend_rect(img1.get_image(), Rect2(Vector2(0, 0), Vector2(32*4, 32*4) ), Vector2(0, 0) );
        	image1.blend_rect(img2.get_image(), Rect2(Vector2(0, 0), Vector2(32*4, 32*4) ), Vector2(100, 0) );
        	texture1 = ImageTexture.create_from_image(image1);
        
        
        func _process(_delta: float) -> void:
        	queue_redraw();
        	
        
        func _draw() -> void:
        	draw_texture(texture1, get_global_mouse_position() );

        xyz they're approaching the whole thing in a bit of a misguided way

        xyz I dont identify myself has "they", she's, or it. Iam just one guy making a tilemap, i dont have a team on my back

          jonSS I dont identify myself has "they", she's, or it. Iam just one guy making a tilemap, i dont have a team on my back

          I don't give a rat's ass about how you "identify yourself". I used "they" as a neutral pronoun in the sense described under 3 in the dictionary here. Not sure why you're even bringing this up.

          Good to hear you finally got something working though. Hopefully it'll be applicable for what you're ultimately aiming for. Although I do sense more trouble coming up along the way 😉

            xyz The OP is working on a sort of a custom tilemap plugin with the idea to implement pre process effects like blur on whole tile layers. Imho, judging from the several questions asked so far, they're approaching the whole thing in a bit of a misguided way, and also trying to bite off more than they can chew with their current level of technical knowledge

            xyz I used "they" as a neutral pronoun in sense described under 3 in the dictionary here. Not even sure why you're ruminating on this.

            Its dificult to undertand the things you write...
            If you are such an iluminated and intellectually gifted, you could use your "rat's ass" to make a tilemap yourself ( or something else ). That way you could show everybody else how dumm other people are in relation to you.
            But you just dont do it ? Not even a simple 5min "blend_rect" example...

            • Toxe replied to this.

              jonSS But you just dont do it ? Not even a simple 5min "blend_rect" example...

              What's the point though? A working example was already there, why repeat that?

              jonSS I dont identify myself has "they", she's, or it. Iam just one guy making a tilemap, i dont have a team on my back

              It's called "being polite", calm down.

              Good job on getting it to work!

              This thread is getting psychoactive 😃

              @jonSS You haven't even thanked @Toxe for providing a working example, but instead went on barking at me for not doing so. I'm a lazy ignorant bastard and I code only for money. So no tactic other than cash will work to get something copypasteable from me.

              Kids these days 🤣

                xyz what ?
                I dont think @Toxe felt offendend ? but now that you mentioned "i didnt tanked him" theres a chance hes going to be...

                I wasnt barking at you. If you saw the kind of krap i take for doing stuff for free. Compared to this is nothing.
                I was just trying to speed this up and avoid the inevitable in getting stuck on 1 function, that could take 5 to 10min, instead i got stuck for 2 days on "blit" has its already common

                xyz Kids these days 🤣

                Iam problably already much older than you.

                • xyz replied to this.

                  jonSS I dont think @Toxe felt offendend ?

                  It doesn't matter how he felt. Saying "thanks" to someone that put some effort in to help you is a part of the civilized etiquette. Why do I even have to point this out? Remember that you're interacting with actual people here, not with code generating chatbots.

                  jonSS Iam problably already much older than you.

                  Ya think? Your behavior would suggest otherwise.

                  Look, are you here to solve problems and learn something or to engage in pointless arguments over inconsequential things? If former is the case, don't act like a spoiled brat entitled to having their code written for them. Be grateful that people are even trying to help you in any way. Cultivate patience, focus and receptiveness to new knowledge and you'll reap great benefits in discussions here as well as in your overall coding endeavors. Otherwise, you're wasting everyone's time, especially your own.