1

Coordinate

I. What is coordinate?

  • Coordinate is the position of the sprite on the stage, with corresponding X and Y coordinate. The coordinate system can describe the position of the object quantitatively. The positive and negative value of X coordinate represents the left and right; the positive and negative value of Y coordinate represents the up and down.

  • By numbering all points in the stage, we can find each point in the stage with the coordinate system.

  • Below the coding area, you can see the sprite's coordinate:

II. Coordinate is the centeral point

  • Sprite's coordinate is its coordinate of central point.

    If you change its central point, its position would be changed accordingly.

  • For example:

    In figure 1 and figure 2, the coordinates of Codemao are both [X:120,Y:-150]. But in figure 1, the central point is on the face of Codemao, while it is on the hand on Codemao in figure 2.

    Obviously, with the same coordinate but different central point, the actual position of Codemao would be different.

III. Stage coordinate system

  • Click button on bottom right in the stage, you can see the coordinate system on the stage. (See picture below)

  • Now you can see the sprite's coordinate clearly.