GDevelop's equivalent of Gamemaker surfaces?

Note: While it may look like it, I’m not trying to start a game engine war, nor am I saying one is better/worse than the other. I find that feature in GM clever and amazing, and just wondering if it’s possible here as well.

GameMaker has this concept of ‘surface’, you create a surface (basically you allocate video memory for a sprite of certain size) and then you just draw sprites on it for eg. you draw dead NPCs, blood splatters, tiremarks, fake static shadows, etc.

Then you just check if that surface exists and draw it in the next frame and this helps you save memory and drawcalls as you don’t have to draw every sprite on every frame, you just draw that big sprite instead.

Is it possible to do something similar in GDevelop?

Thank you…

Not sure if that is what you mean, but there is an extension to render an object, layer or scene into a sprite.

2 Likes

I searched for render and found that you created this extension, but I am not sure how to use it. :sweat_smile:

So what I need is:
Draw certain spriteObject at certain position, iwth certain opacity, rotation in the the memory/ dynamic sprite (and it may be further updated in future frames)
Draw my dynamic sprite with certain position as origin.

Can this be achieved with RenderToObject extension?

If you can “bake” a layer, then I suppose you can add the necessary objects on a specially created layer and then “save” it. Resembles a screenshot. Sounds interesting, you will have to try =)

all rotation/opacity/visual parameters should be taken into account as it is using GDevelops internal renderer, just rendering into a texture instead of to the screen. For the position though, the extension temporarily sets it to 0 for the time of the snapshot. Add the following code to the extension to offset that position:

2 Likes