How do the x and y positions work for arranging items on the screen?

The x and y coordinates represent pixels on the screen. X is the horizontal postion, and y is the vertical  position. It is important to note that the x and y coordinates also depend on the the object’s reference point, as the x and y coordinates are relative to the this.

X And Y Positioning Illustration

As defined by Corona:

object.x: specifies the x-position (in local coordinates) of the object relative to the parent — the parent’s origin to be precise. Specifically, it provides the x-position of the object’s reference point relative to the parent. Changing the value of this will move the object in the x-direction. Changing the object’s reference point will change the object’s x and y points without moving the object.

object.y: specifies the y-position (in local coordinates) of the object relative to the parent — the parent’s origin to be precise. Specifically, it provides the y-position of the object’s reference point relative to the parent. Changing the value of this will move the object in the y-direction. Changing the object’s reference point will change the object’s x and y points without moving the object.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: