Centering Menu to Player position, yet within Layout

0 favourites
  • 1 posts
From the Asset Store
A well commented template with list menus and shops to use in your top-down RPGs or metroidvania games!
  • 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).

    Questions:

    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

  • Try Construct 3

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

    Try 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)