How do I get container to respect the items position ?

Get help using Construct 2

Post » Tue Sep 29, 2015 8:28 am

How do I get container to respect the items position ?
When I instantiate the a container with the items, they are ALL in the center of the container.

When I try to duplicate them in a loop, and try to move all the items to their respective relative position, the WHOLE container move !

How do I get container to either:
1: Create the Container instance with all the item's position in place like every OOP program out there.

or

2: Move the individual items inside the container wihout the whole container moving ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Tue Sep 29, 2015 9:09 am

If you move one item in a container, it shouldn't move any others. If it is, then something else is causing it (are they pinned together?).
When an item in a container is created, it will create all the other items in the container as well. You can create one item, and then create an event: On created, where you can position the other items relatively.
B
45
S
21
G
65
Posts: 1,115
Reputation: 38,221

Post » Tue Sep 29, 2015 10:02 am

Thank you, but what if during "on Create" some items in the container are not created yet ? Like for example there are five controls and the first control was JUST created and inside its onCreate Code, there are codes to control the position of everything else in the container but in that nano second, they are not yet created ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Tue Sep 29, 2015 5:41 pm

If you create one object that is part of a container, every other object that is a part of the container will have been created at the same time. You won't have an issue where something wasn't created yet, unless I'm misunderstanding your situation.
B
45
S
21
G
65
Posts: 1,115
Reputation: 38,221

Post » Wed Sep 30, 2015 8:33 am

Thank you !!!!!!!!!!
B
12
S
3
Posts: 288
Reputation: 1,694


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo, lahbach and 14 guests