How do I access a different image point in an expression?

Get help using Construct 2

Post » Wed Feb 22, 2017 5:21 am

you can do stuff like "set position object (image point Y)". I .e. chose the image point.

But in expressions, you dont seem to be able to. e.g. you can say

Value -> 100 + object.imagePointX

but you cant say which image point it will get the X value from. I assume it is always using image point 0?

Is there any way to get the x and y of image point 1?

The reason is I want one image point in the center to allow easy centering, and I want another one which is more or less the top left to make object placement easier. I know I can calculate one from the other by adding/subtracting half the width, but I would prefer to be able to use the image points directly if possible?
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Wed Feb 22, 2017 5:58 am

I think it's in the manual but you can by index
Sprite.imagepointX(1)

Or by name
Sprite.imagepointX("myImagepoint")
B
94
S
33
G
118
Posts: 5,395
Reputation: 75,851

Post » Wed Feb 22, 2017 10:10 am

Wow, that was easy, Rojo, you are the man!
B
17
S
6
G
3
Posts: 370
Reputation: 3,942


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests