How do I detect the length of time since I pressed

Get help using Construct 2

Post » Mon Nov 19, 2012 2:57 am

So, as the topic say; how do I detect how long I've been touching the display?

Thanks
~B
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Mon Nov 19, 2012 4:47 am

Check out the time section on this page of the system settings, it may help.

https://www.scirra.com/manual/126/system-expressions
B
6
Posts: 3
Reputation: 783

Post » Mon Nov 19, 2012 4:59 am

I don't have construct 2 installed at work but after reading the Deta Time expersions I'm leaning towards this soltuion:

Create a global variable for time touching (maybe TimeTouch)

On touch - > System set value Timetouch = TimeTouch + 60 * dt

On touch lease - System set value TimeTouch = 0.


I can't verify right now. Let me know if this helps.


Source: http://www.scirra.com/tutorials/67/delta-time-and-framerate-independence


NOTE: If you don't use dt the amount of "time" recorded will be based on frame rates. dt will allow proper time tracking regardless of frame rates. At least that's what the documentation says.IsometricRobot2012-11-19 05:03:31
B
20
S
4
G
2
Posts: 124
Reputation: 2,482

Post » Mon Nov 19, 2012 2:18 pm

Thanks guys!

Worked beautifully :)
B
16
S
6
G
6
Posts: 100
Reputation: 4,840


Return to How do I....?

Who is online

Users browsing this forum: Televangelist and 27 guests