[SOLVED] How do I check for multiple image points' existence?

0 favourites
  • 3 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • I'm using image points to set my collision boxes' size and position. I have them in pairs, say image point 1 and image point 2. The col box is placed in point 1 and and sized all the way to point 2.

    I tried checking if both image point 1 and image point 2 exist by accessing it and checking if true, but it still proceeds even if there is no image point 2.

    Tried as condition:

    System: Sprite.ImagePoint(1) ≠ 0

    System: Sprite.ImagePoint(2) ≠ 0

    System: Sprite.ImagePoint("test1") ≠ 0

    System: Sprite.ImagePoint("test2") ≠ 0

    Tried as expression:

    Sprite.ImagePointX(1) <> 0 & Sprite.ImagePointX(2)

    Sprite.ImagePointX("test1") <> 0 & Sprite.ImagePointX("test2")

    Any thoughts on why this is happening?

    Tagged:

  • When image point doesn't exist, it will return the same position as the origin point. So you can use this condition to check if image point is defined:

    Sprite.ImagePointX("name")≠ Sprite.X
    or Sprite.ImagePointY("name")≠ Sprite.Y
    
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks dop2000 for the reply, seems to have done the trick!

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