Creating progress bars

Get help using Construct 2

Post » Tue Jul 23, 2013 1:09 am

My project is going to use extensive use of progress bars. Currently I'm using a tiled background with mix of events with an object specific to each need for it.

Here's my current code:



Is there a way I can create/destroy these objects as I need them and/or simplify their usage so I don't have to repeat this block for every progress bar?Mylon2013-07-23 01:12:56
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Tue Jul 23, 2013 3:06 am

I'm kind of a noob at programming, but couldn't you make this block a function or an array and then just use call?
B
5
Posts: 17
Reputation: 286

Post » Tue Jul 23, 2013 4:09 am

The key is to use instance variables on the progress object. That way you can just alter the counter that controls the progress, and use all of the same code for the display.

ProgressTimerSample.capx

I'm using Timers here, but they are just an means to an end.
ImageImageImage
B
71
S
20
G
190
Posts: 3,534
Reputation: 108,342

Post » Tue Jul 23, 2013 7:52 am

I tried to look at your sample, Blackhornet, but it says I need the Chrome Console plugin and that plugin is no longer offered. Is it possible for you to make a version that doesn't require that plugin?
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Tue Jul 23, 2013 8:00 am

My mistake.
ProgressTimerSample_noCC.capx

ChromeConsole is 3rd party: http://www.scirra.com/forum/log-text-objects-to-chrome-console_topic47859.html
ImageImageImage
B
71
S
20
G
190
Posts: 3,534
Reputation: 108,342

Post » Tue Jul 23, 2013 2:47 pm

Thanks Blackhornet! I made my own version of the code here:



I'm not sure of a site as easy as imgur is for posting the capx file.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044


Return to How do I....?

Who is online

Users browsing this forum: dokthor, Exabot [Bot], maldrok, zenox98 and 13 guests