Centering Menu to Player position, yet within Layout

Get help using Construct 2

Post » Fri Jan 02, 2015 12:26 am

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?

Image

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
Check our 2D assets platform!

http://ask4asset.com
B
7
S
1
Posts: 13
Reputation: 715

Return to How do I....?

Who is online

Users browsing this forum: RobertMKD and 7 guests