Get x,y of image points

0 favourites
  • 5 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Is it possible to get the x,y coordinates of an instanced object's image point(s) on the layout?

    What I'm trying to do : In the game you can place rectangular objects (construction) and I want to save the coordinates of 4 positions within each newly placed object to be referenced later by storing them in an array.

    I thought about having a toggle for when the object is first placed, which spawns a new placeholder object on each image point and saving their coordinates before destroying them but it seemed inefficient.

    Hence the question, is there a way to get the coordinates of instanced image points?

    My apologies for confusion in the explanation, will clarify if needed

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes of course

    Sprite.ImagePointX(1)

    Sprite.ImagePointY(1)

    gives you the image point 1 location of sprite.

  • sprite.imagepointx(1) and sprite.imagepointy(1)

    1 being the index of the image point, so sprite.imagepointx(0) will give back sprite.x

  • thanks guys! Now to figure this mess out..

  • Or by name:

    sprite.imagepointy("thisIsTheNAMEOfTheFirstImagePointIMade")

    sprite.imagepointx("thisIsTheNAMEOfTheSecondImagePointIMade")

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