How do I get the image Point coordinates of the origin?

0 favourites
  • 4 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hello, I'm trying to the image point of the origin from a sprite and the result is always 200, 150. No matter where I put the origin.

    This is my code:

    imagePointsX = puzzle.x + piece.getImagePointX(i); imagePointsY = puzzle.y + piece.getImagePointY(i);

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I actually think that's normal behavior. If you change the origin of your sprite, the x and y position on the layout will stay the same. Only the image will move relative to the origin. So if you put your origin at 0,0 instead of center, the image will just shift with height/2 and width/2, and keep the x and y position the same.

    Maybe it's better to use another image point instead of origin?

    But i'm not sure if I fully understand your question...

  • Hello, I'm trying to the image point of the origin from a sprite and the result is always 200, 150. No matter where I put the origin.

    This is my code:

    imagePointsX = puzzle.x + piece.getImagePointX(i); imagePointsY = puzzle.y + piece.getImagePointY(i);

    If you want the "image point of the origin" just use piece.x and piece.y

  • getImagePointX/Y already returns a value in layout co-ordinates, so you should not add the object position to it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)