Way to set X and Y to Upper Left?

Discussion and feedback on Construct 2

Post » Wed Jul 27, 2011 3:36 pm

Hi,

is there a way to set the coordinates of every object on a layout to 0,0 (up-left) instance of the center of the object?

I tried with instance variables (.X-.width/2) but the number stays 0.

Any ideas?xeed2011-07-27 15:47:13
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Wed Jul 27, 2011 4:29 pm

By default, there's no way to change this. The hotspot IS the center.
Maybe in future releases of C2 will the hotspot be editable as well as the add of points (like in CC).

But as of now, you would have to replace manually any reference to Sprite.X by (Sprite.X - Sprite.Width/2) and Sprite.Y by (Sprite.Y - Sprite.Height/2).
This is longer to write, but you would achieve what you expect.

Once again, instance variable is a variable contained by your object but with no direct affect on it.
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: 7,000
Reputation: 57,795

Post » Wed Jul 27, 2011 4:45 pm

OK Thanks :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to Construct 2 General

Who is online

Users browsing this forum: TheRealDannyyy, zenox98 and 14 guests