0 Favourites

How do I get a Progress Bar to show progress

  • 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.

  • 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}

  • 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

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Something like this?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,136
karshinkoff's avatar
karshinkoff
Unread sticky
89 110,331
optiktr's avatar
optiktr
Unread hot topic
59 9,607
nastycloud's avatar
nastycloud