How do I Position GUI Elements inside moveable popup menu

Get help using Construct 2

Post » Fri Sep 19, 2014 2:14 pm

Is there any "container" which allows to position all elements inside relatively to container?

I have some form elements (not sprites), which should have static position relative to popup window drawn in game, and the popup window has to be bound to current window scroll.x and scroll.y position, so when the game scrolls somewhere - the popup window goes with it.

Only way I found is to create any window element, and add Anchor Behaviour to it,
then for every element inside add Pin Behaviour and set them pinned to popup window.

Project loses its clarity, when I need to add same pin behaviour for every new Interface element.
Last edited by Antraxis on Sat Sep 20, 2014 9:02 am, edited 1 time in total.
B
4
S
1
Posts: 20
Reputation: 392

Post » Fri Sep 19, 2014 3:22 pm

I'd just use a group in which the elements are created and or spawned at the right positions and activate deactivate that group..
All elements would be within that group so clearity won't be lost..
That way the positions of your elements wouldn't have to be calculated every tick, for they would only exist when needed..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Sep 19, 2014 3:26 pm

You could try to use containers to spawn them and destroy them together, and place them at runtime using the on created condition to plqce them, that being combined with a pin.

Also, try to spawn them on a layer with a parralax of 0,0, so they won t be affected by scrolling.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Sat Sep 20, 2014 9:05 am

Using a "user interface" layer with parallax 0 sounds like a great solution. Thanks for both options to solve this problem.
B
4
S
1
Posts: 20
Reputation: 392


Return to How do I....?

Who is online

Users browsing this forum: Syazanie Amirin and 6 guests