Loop and create objects and set new position

Get help using Construct 2

Post » Tue Jun 18, 2013 9:35 am

Hi there,

I'm currently stumped on an issue where i'm looping through some XML elements and dynamically creating new objects to put the data in. The problem i'm having is that i want to position each new object below the previous data entry.

At the moment it's putting the data on top of each other.

I understand what logic i need, i need a way of incrementing each data entry by X amount of pixels but from the most recent created object rather than the first object.

Unable to upload capx due to copyright, but here are some screenshots.

Logic:-


B
13
S
2
Posts: 87
Reputation: 1,244

Post » Tue Jun 18, 2013 3:04 pm

Simpliest way I see is to set up 2 local variables in the ForEach loop, and saving at the end of each iteration X and Y of the new Leader_Flags.
You can also pick the last created instance of LeaderFlags, but it won't be the best to manipulate...
B
17
S
8
G
4
Posts: 461
Reputation: 6,087


Return to How do I....?

Who is online

Users browsing this forum: dokthor, JaredX, Monkin8r and 11 guests