[SOLVED]-[wasn't a bug] Button move to layer

Bugs will be moved here once resolved.

Post » Sat May 26, 2012 6:40 pm

This is a simple bug in Construct2.

You can create an action that moves a sprite or a text to certain layer, but you can't to the same with a button. Buttons don't have 'move to layer'.

Steps to reproduce:
1-Add event > system > every tick (could be anything here)
2-Add action > select a button from your project > ??? there is no move to layer

If you do the same to a text object you have that option.

It is also missing the option to change z order(move to top and move to bottom) but I realize it may be not possible to do with a button. Maybe?
tomasabril2012-05-26 19:12:51
B
18
S
1
Posts: 19
Reputation: 1,473

Post » Sat May 26, 2012 6:46 pm

I don't think this is a bug. Here is what the manual says about buttons and other form controls:

Form controls are actual HTML elements floating above the game canvas in the HTML page. Therefore, nothing can be displayed on top of a form control, apart from other form controls.

Form controls position themselves according to the layer parallax, scale and so on. However they are not truly "in the game" (since they float above), so it is recommended to avoid using scrolling, parallax and layer scaling with form controls, otherwise the end result can feel unnatural.
B
16
S
4
G
1
Posts: 40
Reputation: 2,705

Post » Sat May 26, 2012 6:58 pm

As @jimand notes from the manual, buttons and text boxes aren't actually on a layer. They float above the whole canvas. So I'm not sure it makes sense to add actions to move them to a different layer, nor to change their z order.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat May 26, 2012 7:07 pm

Oh I see. Thanks for the explanation.
The problem is that I want a button with the Global property. And I want it to always be on certain place in the screen(like parallax 0, 0)... nevermind

I fixed it using the 'pin' behavior.
I pinned the button to a global sprite that goes to the 'hud' layer with parallax 0,0
now its like the button is in that layer

Thanks for the fast answers!!!
tomasabril2012-05-26 19:15:40
B
18
S
1
Posts: 19
Reputation: 1,473


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests