1
votes

It's possible to reference a texture atlas using level editor or it must be done in code?

For example I have an atlas foo.atlas, when I am creating a node in the level editor I want to set this atlas as the texture for my node.

1

1 Answers

1
votes

If I understand you correctly, you just need to set sprite's texture properly. In scene editor, select your sprite and choose a texture from dropdown menu:

level editor

This will work for either, textures stored in assets catalog, and textures stored inside .atlas folders (the old way for creating atlases).

EDIT:

You can use Action editor to create complex animations using actions, and have the immediate preview. Also, simple animation with textures can be done using this editor.

To do this, find AnimateWithTextures action from Object Library Object library and add it to your node (just simply drag it).

Then select the AnimateWithTextures action and open the Media library (the Media Library is the button to the right of the Object Library button). By selecting the AnimateWithTextures action, you will be able to modify it, and a window like this will show up:

enter image description here

Then just drag textures from Media library to the area which says "No Images", set a delay and you are good to go. If you want to make an animation infinite, or to play it certain number of times, you should click on "repeat" icon which will show up when hover above the selected animation (animation should look blue).