how to reference an image point in events?

This forum is currently in read-only mode.
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • I have a sprite "sprite1" where I have defined an image point that I have called "pointA".

    I'm trying to reference it in an event

    system->object overlaps point->sprite1.ImagePointX(Imagepoint),sprite1.ImagePointY(Imagepoint)

    what I am supposed to write in the parenthesis?

    I have tried

    sprite1.ImagePointX(pointA)

    sprite1.ImagePointX('pointA')

    sprite1.ImagePointX("pointA")

    none of these work, so what is the correct way to reference an image point that I have created?

  • Its sprite1.ImagePointX("pointA")

    So you've either got the string wrong, or the system overlaps point does not go off of relative coordinates, or you're never getting that exact point due to subpixel positioning.

  • Actually I have found out that you have to reference with the number of the image point, so if it's the first image point it is sopmething like

    sprite1.ImagePointX(1)

    The quotes don't work

  • This just really helped me, thanks!

  • Actually I have found out that you have to reference with the number of the image point, so if it's the first image point it is sopmething like

    sprite1.ImagePointX(1)

    The quotes don't work

    I'm writing this in case someone looks back at this post. Referencing the name of the image point DOES WORK. I don't know if it has been fixed/added in an update after this conversation or has it been there since 2012 but you can do either of these:

    sprite1.ImagePointX("PointA")

    sprite1.ImagePointX(1)

  • Hey guys.

    I have a similar question, and I think this is the correct place to put it:

    How do I get the ImagePointName of an image point?

    Specifically, something like

    Sprite.ImagePointName(0) => "Origin"[/code:2m5gz3f4]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Data you want to save goes in a variable. So press V on the keyboard when the correct column of code is highlighted and make you a variable called "IPName0" (Or Whatever). Then in the place where you want to designate it add the action of: System > Set Variable, Then select the variable you created and the box that allows you to put the result also takes any expressions so you are going to use Sprite.ImagePointName(0) I am not sure why you are saving the name of the Image Point because using the expression above Is always going to be the same value as the variable you are going to create doing this meaning you are only making one value equal another and in result having 2 references to the same piece of information Sprite.ImagePointName(0) or IPName0 (same info can use either)

  • This was extremely helpful, thanks!

  • Sprite.ImagePointName(0)

    This doesn't work.

    I am not sure why you are saving the name of the Image Point

    Not saving. Comparing. Follow this pseudocode:

    [ul]	[li]For each Imagepoint in TorsoSprite[/li]
    	[li]- If Imagepointname contains "shoulder"[/li]
    	[li]- - attach an arm[/li]
    	[li]- else if imagepointname contains ...[/li]
    [/ul][/code:sil8scvm]
    
    This is extremely useful.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)