How do I get a Progress Bar to show progress

Just started using Construct 2? Post your questions here

Post » Fri Jun 06, 2014 10:41 pm

Hi,

I've got a progress bar object in my layout and attached a timer behaviour to it. What I am trying to do is set the progress shown on the bar to be the current time on the timer, but I can't seem to get it to work.

I've tried setting it to ProgressBar.Timer.CurrentTime("time"), but that doesn't seem to work. I checked in the manual which says that the parameter is a tag, but I don't really know what that means.

Any help on this would be much appreciated.
B
3
Posts: 1
Reputation: 177

Post » Sat Jun 07, 2014 4:08 am

Progress bar is designed to show progress, so you have to set the maximum. And tag is the name of a specific timer, you have to start it before using its CurrentTime.
Say you set the Maximum of the progress bar to 10, then do this:
> ProgressBar On Created -> ProgressBar Start Timer "MyTimerName" to ProgressBar.Maximum
> Every Tick -> ProgressBar set progress to ProgressBar.Timer.CurrentTime("MyTimerName")

Now the progress bar should keep increasing when you run the game, and fulfilled at 10s. Then you can do some actions:
> ProgressBar On Timer -> {Any actions you want to do here}
B
13
S
2
Posts: 11
Reputation: 786

Post » Fri Jul 18, 2014 4:08 am

PixelPicoSean wrote:Progress bar is designed to show progress, so you have to set the maximum. And tag is the name of a specific timer, you have to start it before using its CurrentTime.
Say you set the Maximum of the progress bar to 10, then do this:
> ProgressBar On Created -> ProgressBar Start Timer "MyTimerName" to ProgressBar.Maximum
> Every Tick -> ProgressBar set progress to ProgressBar.Timer.CurrentTime("MyTimerName")

Now the progress bar should keep increasing when you run the game, and fulfilled at 10s. Then you can do some actions:
> ProgressBar On Timer -> {Any actions you want to do here}


capx is better :)
B
13
S
5
G
4
Posts: 176
Reputation: 4,429

Post » Fri Jul 18, 2014 9:59 am

Something like this?
You do not have the required permissions to view the files attached to this post.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Beginner's Questions

Who is online

Users browsing this forum: Lordshiva1948 and 1 guest