"time", but for layouts?

Get help using Construct 2

Post » Sun May 19, 2013 11:41 pm

Is there something like "time", but in layout context? The regular "time" is the time in seconds since the global game start, but I need to measure the time since the last (re)start of the current layout.

My workaround right now is to increase a variable every second.
B
66
S
25
G
30
Posts: 436
Reputation: 18,182

Post » Mon May 20, 2013 12:59 am

1. When a layout restarts, set a variable "layoutTime" equal to the time
2. If you wanna know how long since the layout restarted, take the time - layoutTime
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Mon May 20, 2013 7:05 am

An increasing variable is the best way to do it.

Make a Global Variable LayoutTime
On start of layout:
Set LayoutTime to 0

Every Tick
Add 1*dt to LayoutTime (It will tick up at a rate of 1 per second)
B
15
S
4
G
4
Posts: 294
Reputation: 3,225

Post » Mon May 20, 2013 12:06 pm

[quote]Add 1*dt to LayoutTime (It will tick up at a rate of 1 per second)[/quote]

That's what I'm doing right now.. ah well. I was hoping to have missed a system variable to poll
B
66
S
25
G
30
Posts: 436
Reputation: 18,182


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests