Center help

Get help using Construct 2

Post » Wed Mar 21, 2012 12:20 am

is there a easy way to centering in construct 2???

I want it to auto adjust to the users screen, but with the centering expression I have it will only work with the dimensions I have set it to. 2000,2000 -> Layout size
1000,1000 -> windows size

Centering expression-> :

x = scrollx - WindowWidth + LayoutWidth/5 + 150
y = scrolly - WindowHeight+ LayoutHeight/10

Is there a better way to center in construct 2?

I'm trying a menu that pops up when the user clicks "Open Menu" in his/hers game, to center menu-screen.
B
5
Posts: 23
Reputation: 446

Post » Wed Mar 21, 2012 12:32 am

^ Also I've tried

x = WindowWidth - TiledBackground3.Width /2
y = WindowHeight - TiledBackground3.Height /2

still does not center.
B
5
Posts: 23
Reputation: 446

Post » Wed Mar 21, 2012 12:48 am

You may want to put your menu on a different layer than the rest of the game elements, and have this layer's parallax set to 0, this way, even if scrolling in a big layout, the elements of that layer will appear to not move.

Check again the 7th page of the beginner's guide, talking about the HUD.

You also should not use a 1000X1000 window size, not all monitors can handle it.
You should rather use a lower resolution, and make it full screen.
For more informations about this check the tutorial about supporting multiple screen sizes.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Mar 21, 2012 1:06 am

Thank you so much.
B
5
Posts: 23
Reputation: 446


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests