Object in center of the screen

Get help using Construct 2

Post » Mon Oct 21, 2013 10:48 pm

How can I make an object spawn in the center of the screen regardless of the users screen resolution?

I've tried using
Browser.ScreenWidth /2
Browser.ScreenHeight /2
as well as several other settings to no avail.

I also tried playing around with the objects origin point and some other 'tricks' but I couldn't get anything to work consistently.

Also, in case it makes a difference, I'm using Scale Outer for this project.

Any help would be appreciated.

Thank you.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Mon Oct 21, 2013 10:59 pm

Set the X to WindowWidth/2 and the Y to WindowHeight/2 when you create the object.

B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Mon Oct 21, 2013 11:02 pm

I tried that as well and unfortunately it's not working.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Mon Oct 21, 2013 11:04 pm

create object at x = scrollx and y = scrolly
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Mon Oct 21, 2013 11:11 pm

mindfaQ, that worked. I think that's about the only thing I didn't try too! Thank you very much.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991


Return to How do I....?

Who is online

Users browsing this forum: DolyGamesCosmos and 21 guests