Different textures for Tiled Sprites?

Is there any way that I can add different “animations” for a tiled sprite rather than just one? Why does it have to be only one? Because I created a game and the borders and everything else like platforms that adjust their scale randomly are made from tiled sprites and know I want to add themes to the game. But I can’t because only one texture is allowed per tiled sprite.

Will this ever be added to Gdevelop?

Yeah, that’s a limitation that can be a tad frustrating.

Not properly tested, but a thought to overcome this limitation - you could give the tiled sprites the same base name, but append a sequential number at the end (e.g BorderTile1, BorderTile2, BorderTile3…) Then add them to a group called BorderTiles.

Then, at the start of the scene, find each existing border tile sprite, get it’s height, length, x & y position, delete it and create a new one with those values, using the Among objects BorderTiles, create object named "BorderTile" + VariableString(LevelNumber) ....

I tried that but What I tend to avoid is cluttering my objects panel, and that method does just that.

Hopefully they will add a method to categorize the objects menu.

You could rearrange and group objects in the panel by dragging them, so you can have all the border sprites one after the other, all platforms together etc. It’d create an organised clutter :smiley: .

1 Like

Hahahaha, Sounds like my room :joy: :joy::joy::joy::joy:

That reminded me of this gem http://bash.org/?5273 (from the pre-forum days when bulletin boards & IRC ruled the internet)

Depending on what exactly you need, the “Image Offset” action can help you.

Using standard naming and string manipulation like MrMen suggested is what I did as well:
VariableString(Theme) + “BG1”
VariableString(Theme) + “BG2”
etc.

What I sometimes do is Create a button object and then add a variable called name or id, etc and then name each button like “( Name: ShopButton, ID: CloseButton )”

Works good, the downside is that I need to declare the “name and id” for each sprite I am clicking on in the events menu.

Basically like creating a class in Web-dev :joy: