When does anchor behavior take effect?

Discussion and feedback on Construct 2

Post » Thu Feb 14, 2013 6:25 pm

From experimentation, it would seem that anchored objects are not moved to their anchored position until after the events in an "On start of layout" trigger.
Is this correct? I have been working on a minimap with the MM field anchored, and calculating the offset would come out wrong if the calcs were done in the "start of layout" trigger, but they'd come out right if done anytime after that. I ended up making a combination trigger of "every tick" plus a do-once condition to make it work.
I would just like to confirm the theory and make sure I am not making an assumption that will mess me up later.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Sun Feb 17, 2013 3:44 am

My one and only bump, in case anybody missed it.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Sun Feb 17, 2013 4:03 am

Can't you just have something that fires off after the start of layout action? Like maybe a function called in start of layout, and the function handles the Anchor?

Or perhaps, have the HUD/UI layer that is anchored be invisible then after a few seconds anchor everything and then fade them in?

Mainly just brainstorming ways to give you time to get through start of layout first. I haven't messed with it much myself as I haven't had much time today. Maybe someone else has an idea.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Wed Mar 13, 2013 5:19 pm

I had done basicallly what you suggested, in the form of a block that runs every tick, but with a secondary condition based on a do once variable. It works ok, I'm just trying to get a handle on how things work exactly in construct 2.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803


Return to Construct 2 General

Who is online

Users browsing this forum: Andres941, tayxd, TheRealDannyyy and 12 guests