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
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

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
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Oct 04, 2012 7:26 pm

I love you.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Fri Nov 09, 2012 2:42 am

@Ashley

"onLayoutChange" method might not be trigger when the first layout started.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests