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,096

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
382
S
222
G
84
Posts: 23,981
Reputation: 189,217

Post » Thu Oct 04, 2012 7:26 pm

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

Post » Fri Nov 09, 2012 2:42 am

@Ashley

"onLayoutChange" method might not be trigger when the first layout started.
B
107
S
25
G
230
Posts: 4,353
Reputation: 130,894


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests