Use of runtime.layout_first_tick

For developers using the Construct 2 Javascript SDK

Post » Thu Oct 04, 2012 5:57 am

Alright, so this method seemed like exactly what I needed in terms of having my plugin check if the layout has changed, although it's either not working or not working as I would assume. When the game first starts the value is equal to true, but afterwards if you change layouts, restart the current layout, etc. it remains false. Am I missing something here? I'm assuming it should equal true for the first tick of each layout.

For the record, I'm checking the value in my plugin's "tick" method.linkman20042012-10-04 05:58:00
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Thu Oct 04, 2012 3:26 pm

Add a 'onLayoutChange' function to your instance prototype and the runtime will call it when the layout changes. The Facebook object has an example. Something like:

instanceProto.onLayoutChange = function ()
{
    // ...
};Ashley2012-10-04 15:26:32
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Thu Oct 04, 2012 7:26 pm

I love you.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116

Post » Fri Nov 09, 2012 2:42 am

@Ashley

"onLayoutChange" method might not be trigger when the first layout started.
B
108
S
26
G
268
Posts: 4,456
Reputation: 150,247


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 2 guests