How do you change a spritesheet at runtime? #746
Replies: 7 comments
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). Creature myCreature = new Creature("spritesheetName");
String animationName = "creatureDance";
myCreature.animations().add(new Animation(Resources.spritesheets().get(animationName), true));
myCreature.animations().play(animationName); |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022).
Posted: 2021-03-20 21:49:23
User: ichbintobias2 [] (age: 743 days 🙌; posts: 7)
Hello everyone, for my current project I need to manually change the used spritesheet at runtime. I tried playing around with the values of the @AnimationInfo annotation as well as the setSpritesheetName method.
Removing the entity alltogether and replacing it with another one is also something I thought of but I had no success with this as it is not possible to add entites that are not known to game.litidata at runtime (I think?).
How would you go about this?
Beta Was this translation helpful? Give feedback.
All reactions