Create Menu always on top center like Web menu

Discussion and feedback on Construct 2

Post » Mon Dec 30, 2013 4:37 pm

Hi guys.. I need help to create Menu in my game which position always on top and center of layout something like web menu.
could you tel me step by step or tutorial to create that?
B
4
S
1
Posts: 34
Reputation: 443

Post » Mon Dec 30, 2013 5:26 pm

You just need to create it.

For example, you need a background image for the menu, then the sprites for the buttons. Create a function that creates the background image and the sprites when you call it. Create another function that destroys all of those objects when you call it.

Make sense?
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Tue Dec 31, 2013 12:23 am

yes, I've made ??.. but how to setting the background always on top center position and sprite button stick to the background?
B
4
S
1
Posts: 34
Reputation: 443

Post » Tue Dec 31, 2013 12:49 am

Using the window height and width /2 f centering the x and y positions
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Tue Dec 31, 2013 1:20 am

What BluePhaze said, plus putting on the top most layer and then creating the items in order from back to front. The object you create last in the event sheet will show up top most on that layer.

B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Tue Dec 31, 2013 1:31 am

1st, create a new layer at the top, maybe call it "UI"
2nd, set that new layers parallax setting to 0,0 (instead of the default 100,100)

Voila, the "UI" layer doesn't move while the rest of the game does

is this what you're looking for @resvi?
B
63
S
12
G
6
Posts: 456
Reputation: 8,981

Post » Tue Dec 31, 2013 11:01 am

Thank you every one.. for your best responds.
I mean that menu like web menu. which always on top and center position with menu attributes like user name profile, small photo and another attribute.
I think that I need to create background image for the menu, then the sprites for the attribute and group that and set position to center and always on top Like BluePhaze said.
B
4
S
1
Posts: 34
Reputation: 443

Post » Tue Dec 31, 2013 11:15 am

[QUOTE=BluePhaze] Using the window height and width /2 f centering the x and y positions[/QUOTE]


that almost works :)

till you resize the window   >_>

The window width and height doesnt get updated after a resize it seems :(

been having issues with that for a week trying to make an item slide to the center.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests