-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change animation state via variable #1690
Comments
Why not use background tiles for the UI and replace them with a variable tile index? |
That's a usable workaround most of the time, but it does have limitations. Especially if you want your UI at the top of the screen and/or you want to have parallax I have personally done the thing where you have an actor for every character of the score and this would be a nice upgrade. I bet it would be useful for a lot of different scenarios |
I've switched to using that for now, but it does mean I have to use up more variables.
I considered using actors for each of the digits as well, but I ran into the actor limit very quickly. |
@SGTADMAN If you make a tile sheet with numbers you can display a 4 digit score with just one variable, so it should not use up much. |
Can you provide an example or guide on doing this? |
@SGTADMAN The GB Studio discord is a better place for this perhaps, but sure, here you go! ![]() |
@nielsderijk That works perfectly, thank you very much. |
Is your feature request related to a problem? Please describe.
I'm trying to display HP, MP, and other stats on a UI. I can't use Draw Text due to limits, but I found a way to display it via actors by having animation states, each one displaying a one- or two-digit number as a sprite. I currently have 100 animation states (0 to 99).
Setting an animation state has to be done via a drop-down menu. So the only way I can set it currently is via several dozen nested if statements, which is as tedious to set up as it sounds.
Describe the solution you'd like
I would like the ability to feed it a number (0 to however many states there are). Preferably via a variable. So if the player HP variable is 37, it will display the 38th animation state (seeing as indexing starts at 0).
Describe alternatives you've considered
Another way I found to display it is via an actor per digit, but it still has to be manually set via switch or if statements.
If there's a way of doing this via GBVM script or something, that would also be fine.
The text was updated successfully, but these errors were encountered: