How to put millisecond?

Get help using Construct 2

Post » Tue May 24, 2016 1:41 am

Example: I have text box called "cooldown" , to subtract five seconds , it appears that way:
5
4
3
2
1
You want to appear that way:
5.0
4.9
4.8
...
0.5 ...
Translated
Thank you =D
B
22
S
2
Posts: 44
Reputation: 974

Post » Tue May 24, 2016 3:39 am

create variable with initial value 5

every 0.1 seconds --> subtract 0.1 from variable and set text to variable

variable < 0 --> set variable 0
B
22
S
4
G
3
Posts: 68
Reputation: 2,697

Post » Tue May 24, 2016 4:43 pm

Tuiii wrote:create variable with initial value 5

every 0.1 seconds --> subtract 0.1 from variable and set text to variable

variable < 0 --> set variable 0

it works partially, but when it comes to an integer is so:
1 2 3 4 5
I would like to stay so:
0.0 1.0 2.0 3.0 4.0 5.0
B
22
S
2
Posts: 44
Reputation: 974

Post » Tue May 24, 2016 5:31 pm

I think zeropad(variable,1) will help you.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 24, 2016 5:33 pm

You can call into JavaScript.

Code: Select all
Browser.ExecJS("parseFloat(" & Function.Param(0) & ", 10).toFixed(" & Function.Param(1) & ")")


http://www.blackhornettechnologies.com/ ... l_BHT.capx
ImageImageImage
B
71
S
22
G
257
Posts: 3,791
Reputation: 142,698

Post » Tue May 24, 2016 8:00 pm

Thank you for your help, zeropad it's the JavaScript worked perfectly =D
B
22
S
2
Posts: 44
Reputation: 974


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests