Progress bar link to a timer object

For questions about using Classic.

Post » Mon Mar 29, 2010 10:58 pm

Hi everybody,

First i want to apologize about my low english skill.

I use construct since three weeks and this soft is awesome !

Actually, i have a little problem to do something.

I'm trying to link a progress bar (HUD) to a timer (who decreases to zero). I want that this progress bar appears when the timer starts, decreases, and vanishes when the timer reach zero.

I find in this forum how to make a progress bar (viewtopic.php?f=3&t=4893&p=38880&hilit=health+bar#p38880), how to make a timer (using the behaviour timer), but i don't know how to link this two things together.

Is it possible ? Anybody here can help me to do that ?

Thanks a lot.

(I can make a cap to explain better).
B
1
G
2
Posts: 2
Reputation: 629

Post » Tue Mar 30, 2010 9:43 am

[quote="lawet":hbc1q84j]
I find in this forum how to make a progress bar (viewtopic.php?f=3&t=4893&p=38880&hilit=health+bar#p38880), how to make a timer (using the behaviour timer), but i don't know how to link this two things together.[/quote:hbc1q84j]

I don't think it's possible directly through the timer behavior, since it's missing an expression to retrieve the timer progress. The Timeline object should be good for this, as there is an expression just for that. And I would link you to an example cap too, but when I just tested it the timeline progress would always return 0. So that appears broken to me right now.

You could still get the same effect with variables or by manipulating the width of the progress bar directly or even by using the system timer expression. For example if you always subtracted 10% of the max width of the bar and multiplied that by timedelta (obj.width + X * Timedelta), it would take exactly 10 seconds for that bar to reach 0. And would therefore be like using a 10 second timer to decrease the width.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Mar 30, 2010 1:01 pm

Ok thanks, i will try this :)
B
1
G
2
Posts: 2
Reputation: 629


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests