"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
75
S
28
G
32
Posts: 480
Reputation: 19,711

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
21
S
8
G
6
Posts: 346
Reputation: 4,891

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
75
S
28
G
32
Posts: 480
Reputation: 19,711


Return to How do I....?

Who is online

Users browsing this forum: 7Winter, HellMax, Lordshiva1948, Matei511, Yahoo [Bot] and 56 guests