0 Favourites

Centering Menu to Player position, yet within Layout

  • Hi guys, as the title say, that's what i'm doing.

    I did it already, just wanna see if any of you have any idea to simplify this, maybe i'm over thinking, or you have a different approach?

    What it does:

    When a user click's the player, a menu is created.

    Then i set the position of the menu, by it's center, centralized in the player.

    (I've set the position later and not in the object creation itself because "background_menu_player.Width/2" didn't worked there. I don't know why, and when i tested setting the position with the "Set Position", it worked just fine. )

    Then i did an if statement to see if the x and y value are less than zero (outside layout check).


    Can it be done simpler or with less lines/code?

    Can anyone do the positioning within the object creation work as it did in "Set Position"? Or at least know why it wasn't working. (It just doesn't move, it ignores the value)

    I can't provide capx because of copyright material within this project.

    Thank you

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)