Texture animation #338
Replies: 4 comments 8 replies
-
Hi, and welcome. It's a good question, we don't really have any built-in support for animated sprites. Generally, I can think of two approaches to deal with this:
Good luck :) Let us know how it goes. I'm sure it would be very valuable to others if you could share some details and learnings on the solution you end up with. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tips, I like the custom decorator option, worth a try. I will definitely let you know the results. |
Beta Was this translation helpful? Give feedback.
-
After studying your options and comparing them with my requirements, I realized that implementing your own decorator does not solve the problem of texture animations. I made an animation for all textures in the render interface, the result is good, now it is possible to animate the texture with frames for any decorator or tag. I'm concerned about only 1 issue - performance. Considering that RmluiCore uses TextureHandle as a pointer to the texture, I need to adapt to this in order to be able to update painlessly when the next release comes out. It turns out that I need to store pointers to the texture with animation in some container and look for the texture in this container when compiling the geometry to understand if it is an animation or a regular texture. Question - do you have any plans to make a full-fledged class instead of TextureHandle, which will already have a pointer to the texture itself inside and which will make it possible to make your own class and inherit from it, supplementing it with your own parameters? |
Beta Was this translation helpful? Give feedback.
-
Hey, so I'm coming up against this same issue and I was reading the stuff above to figure out a good solution. @mikke89 essentially what we need is a solution that can be changed by artists without needing programmer intervention. I liked the idea of having essentially a virtual texture name that is replaced at runtime with the updated animation, but I realized when thinking more about it that that would mean you couldn't easily re-use the same animation at different speeds. I think a custom decorator ends up being the best solution; considering they may have spaces in them, I think a string parser would work?
Do you foresee any issues popping up regarding this approach? |
Beta Was this translation helpful? Give feedback.
-
Hello, I've been studying your project for a long time, but it's not clear to me how I can make a simple animation using several textures. For example, there is a button, we set the texture to it with a decorator using ninepatch. But let's say I have 10 textures of this button (frames) and I would like them to change in turn at some interval, thus creating an animation. How can this be done using the available features in RmlUi? Maybe with keyframes? I'm not very versed in html / css, I will be glad to any advice.
Beta Was this translation helpful? Give feedback.
All reactions