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

0 favourites
  • 4 posts
From the Asset Store
4K Hand Painting, 300 dpi and layer layer, psd and png files. 3200 x 4200
  • 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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)