Why is the 0,0 for my layout grid not in the upper corner?

Get help using Construct 2

Post » Fri Oct 28, 2016 9:30 pm

I cannot figure out how to get the 0,0 position properly located in the upper left corner. Right now it is showing something close to -318,-128. I don't know how I got it so offset in the first place.
B
42
S
20
G
6
Posts: 106
Reputation: 6,567

Post » Fri Oct 28, 2016 9:41 pm

Making a quick assumption - You're positioning your sprite at 0, 0 and you see part of it off the layout. By default, the center of the sprite is the origin point, so you are moving the center of the sprite to 0, 0.

To move it to the top left, go into the sprite editor and change the "origin" imagepoint to 0,0.

If that't not it, a screenshot or capx might describe your problem more clearly.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Fri Oct 28, 2016 10:57 pm

My 0,0 is located not even close to the corner. Let's say that my grid layout is 1512, 850. The 0,0 is located at about where 318, 128 should be if 0,0 were in the upper left position. It is currently well within the body of the grid. I just want to set it in its default position.
B
42
S
20
G
6
Posts: 106
Reputation: 6,567

Post » Fri Oct 28, 2016 11:09 pm

I was trying to make a HUD layer. I have traced the issue back to the parallax settings. When I set it back to 100, 100 , the images that I created on that layer snap back to their original position. Setting it at 0,0 causes the all the images on that HUD layer to shift over and down drastically.

There appears to be something about parallax that I do not understand.
B
42
S
20
G
6
Posts: 106
Reputation: 6,567

Post » Sat Oct 29, 2016 12:22 am

From how I understand it, a parallax of 0,0 means that the layer will not pan when the scrollx or scrolly positions change. So if an object on that layer is located at 0,0 for example, then it will always be 0,0 pixels from the top left of the viewport regardless of the scrollx,scrolly positions. If the parallax is 50,50, then if the scrollx,scrolly are at 50% (middle of the layout), then the object will appear positioned halfway from the 0,0 origin of the layout and the topleft of viewport. If parallax is 100,100, then it will be at 0,0 of the layout.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Sat Oct 29, 2016 1:11 am

Look at the manual for expressions, for converting coordinates between the layers.
ImageImageImage
B
71
S
22
G
258
Posts: 3,791
Reputation: 143,198


Return to How do I....?

Who is online

Users browsing this forum: Animate and 11 guests