Making a visual gauge that automatically updates and visually fills/deplets?

mardin

"...pretty please?"
Veteran
Joined
Nov 8, 2015
Messages
231
Reaction score
121
First Language
German
Primarily Uses
Is it possible to make a visual bar/gauge that automatically updates and visually fills/depletes?

So far I've used


which is offline right now, and I have used a crop picture event. The problem with the crop picture event is that the way I've set it up it is a lot of work to do for every gauge and it shows the depletion/fill only step by step. I've used a lot of if and if else statements to crop it based on the variable assembled to the gauge (meaning for example if there is 100 health every 10 steps the picture would crop).

There has to be a better way of displaying that, right? Like in Ren'Py this is just one command.


So what is the best way to make a visual gauge for an evented battle system? One that, at best, visually fills up and depletes!
 

mardin

"...pretty please?"
Veteran
Joined
Nov 8, 2015
Messages
231
Reaction score
121
First Language
German
Primarily Uses
push

ok, so I assume this is not possible. Maybe someone has a tip for implementing gauges the best way?
 

Kentou

Admin
Admin
Joined
Jan 20, 2014
Messages
236
Reaction score
56
Hi mardin,

unfortunately, there is no out of the box gauge element available. But it is possible to build one yourself as you already figured out. I think you can animate it yourself with a loop command and Crop Picture instead of lots of Condition commands. You can then put it into a common event to reuse for multiple gauges.

A rough example/idea for a 200px gauge. The longer the wait the slower the animation speed.
(I also sent you a PM with a fix for the background issue you had a while ago).

Code:
Number Variable [gauge_width] = 200
Loop
  Crop Picture [gauge_width]
  Wait 20ms
  Condition [gauge_width] <= 0
    Break Loop
  Else
    Number Variable [gauge_width] - 10
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.
is there a script call that return how much turn has passed in battle?
Does anyone find this hard to read?

Enjoying my weekend at home to stay Covid free. How is everyone else doing?

Forum statistics

Threads
100,603
Messages
977,740
Members
132,216
Latest member
Darkscythe25
Top