Progress bar

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MarkoSato
Posts: 38
Joined: Fri Apr 22, 2016 7:55 am

Progress bar

Post by MarkoSato »

Hello,

I have an old Pokemon fight like battle in my Stack, where I have a progress bar for showing the HP of the enemy.
So the progress bar ist set on 100 at the beginning.
Each attack subtracts 45 from the progress bar. But it does it directly.
I wonder if I can do it like the old Pokemon games, where the bar is slowly going down to 55% or sth. like that, so that there is no instant jump, more like a little animation.

Best
Mark
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Progress bar

Post by dunbarx »

Hi.

"sth."

Something? I am getting old.

Have you played with progress bars at all? Make one, set the startValue to 0, the endValue to 100 and the thumb position to 50. Now in a button script:

Code: Select all

on mouseUp
set the thumbpos of scrollbar 1 to (the thumbpos of scrollbar 1) - 5
end mouseUp
You don't even need the parens

Craig Newman
Post Reply