Rolling counter values

Get help using Construct 2

Post » Mon Apr 18, 2016 11:25 am

Hi

I wish to make a animated counter, but how do I get the values seperated from 0-9
in teen, hundreds, thousends, .....

Image

Regards
B
33
S
17
G
11
Posts: 350
Reputation: 8,690

Post » Mon Apr 18, 2016 1:13 pm

The image is not visible, and I dont understand exactly what you mean. Could yo be more specific?
MY APPS ON GOOGLEPLAY
ImageImageImage
B
39
S
14
Posts: 100
Reputation: 2,923

Post » Mon Apr 18, 2016 2:00 pm

Ok .. sorry

I think that i need too have each value for tens,hundreds,....

I try with link to dropbox
https://www.dropbox.com/s/wzzahplg881s9h2/Rolling-digi-no.png?dl=0
B
33
S
17
G
11
Posts: 350
Reputation: 8,690

Post » Mon Apr 18, 2016 2:28 pm

@flemmig
Have to be another way with less events, but this could give you an idea.
The capx is not complete, ...
https://www.dropbox.com/s/0meyukohawb1p ... aproj?dl=0
MY APPS ON GOOGLEPLAY
ImageImageImage
B
39
S
14
Posts: 100
Reputation: 2,923

Post » Mon Apr 18, 2016 2:50 pm

OK how about this...

so you're going to need to make a number sprite with animations from 0-9 and then duplicate it for how many digits you want on the counter. Call them something like digit1, digit2, etc. I'm going to assume a four digit counter like your example.

Then on the event sheet:

set digit1 animation to mid(zeropad(YourNumberVariable, 4), 1, 1)
set digit2 animation to mid(zeropad(YourNumberVariable, 4), 2, 1)
set digit3 animation to mid(zeropad(YourNumberVariable, 4), 3, 1)
set digit4 animation to mid(zeropad(YourNumberVariable, 4), 4, 1)

Haven't tested but that's what I'd try?

EDIT: removed a little bit of redundancy, whoops. I was using str() forgetting that zeropad() already puts out strings.
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 201
Reputation: 3,460

Post » Tue Apr 19, 2016 6:20 am

@Rasputin

Thanks .. but cant open your project-file missing xml1

@mikehive

Something like that .. but was thinking off haveing 10 sprites with a diff animation each ending at 0-9
theni if value is 2016 then ..

Create object > sprite-6
Create object > sprite-1
Create object > sprite-0
Create object > sprite-1

any Idear :-)
B
33
S
17
G
11
Posts: 350
Reputation: 8,690

Post » Tue Apr 19, 2016 9:31 am

New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Tue Apr 19, 2016 9:57 am

@Kyatric I take off my hat (I don´t know if this expresion have the same meaning in english than in my lenguage, otherwise I mean: impressive)
Just 7 events, :)))
MY APPS ON GOOGLEPLAY
ImageImageImage
B
39
S
14
Posts: 100
Reputation: 2,923

Post » Tue Apr 19, 2016 3:16 pm

@Rasputin: I think in English it is "I tip my hat to you", or something like that, but I get the idea nonetheless, we have a close enough expression in French as well.
C2 allows to do a lot of manipulations quite easily.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483


Return to How do I....?

Who is online

Users browsing this forum: Linetaru and 9 guests