Center Sprite

Get help using Construct 2

Post » Fri Jun 07, 2013 8:45 pm

Hi

Can someone help me out here ..
My logic has stopped :-)

In my Capx file ive tried to simply center a sprite

hope u will give it a look

https://dl.dropboxusercontent.com/u/22406377/CenterSprite.capx

Cheers

Flemming
B
28
S
15
G
10
Posts: 338
Reputation: 7,837

Post » Fri Jun 07, 2013 9:13 pm

center as in? X value center? or width/2 height/2? Becasue when i pres your giant purple square he centers nicely on X axis.
If you want it on the Y axis aswel you need to do (WindowHeight/2)+(Center/2) because if wont test on the center of the Center object but on the end of the object.

small capxof what i think you want.mrPeanut2013-06-07 21:14:26
B
9
S
3
G
3
Posts: 70
Reputation: 1,990

Post » Fri Jun 07, 2013 9:21 pm

Hi

thanks for reply

Yes as in center X

BUT it does not align center on all sizes
and that the weird thing

trying a small window .. 480 it goes to let after reload page
in about 800 it looks right
and at 1600 not right

Seams as the window height have and influence


B
28
S
15
G
10
Posts: 338
Reputation: 7,837

Post » Fri Jun 07, 2013 11:30 pm

create a invisable sprite center it and add a anchor behavior and anchor all the sides to the same outer side then that sprite will always be the center position
ps.this will only work if the different screen sizes are from scaleing
B
39
S
10
G
7
Posts: 514
Reputation: 9,546


Return to How do I....?

Who is online

Users browsing this forum: KittenKatja, MAVERICK, QuantumMMX, Zion and 12 guests