how to reference an image point in events?

For questions about using Classic.

Post » Wed Aug 01, 2012 11:10 pm

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?
B
3
S
1
G
3
Posts: 45
Reputation: 1,140

Post » Wed Aug 01, 2012 11:27 pm

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.
Image ImageImage
B
168
S
50
G
164
Posts: 8,227
Reputation: 105,573

Post » Thu Aug 02, 2012 12:15 am

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
B
3
S
1
G
3
Posts: 45
Reputation: 1,140

Post » Fri Dec 18, 2015 9:34 am

This just really helped me, thanks!
B
6
S
2
Posts: 7
Reputation: 478

Post » Sun Sep 04, 2016 9:34 am

declan_gage wrote: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)
B
5
S
2
Posts: 4
Reputation: 488

Post » Thu Jun 29, 2017 6:50 pm

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
Code: Select all
Sprite.ImagePointName(0) => "Origin"
B
5
S
1
Posts: 2
Reputation: 629

Post » Tue Aug 01, 2017 11:53 am

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)
B
6
S
1
Posts: 14
Reputation: 378


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests