###

» Wed Feb 13, 2013 11:03 pm

sprite1.X is the absolute X coordinate of sprite1's origin point. imagepointX similarly gives the absolute X coordinate of sprite1's image point relative to Construct's coordinate system (the top left corner). So subtracting the two gives us the difference or relative position of sprite1's imagepoint to sprite1's origin point. This is important because with the Set Position action we are forced to figure out where the sprite's *origin* has to be in order for it's image point to be in the correct place.

For example, if we have a sprite with origin (1,2) and imagepointXY (3,2) (which means relative difference of (2,0) which you want to move to sprite2's point (5,6) this is how the expression math works out:

5 - (3 - 1) = 5 - 2 = 3

6 - (2 - 2) = 6 - 0 = 6

Notice how in the parentheses we got the relative diffence between sprite1's origin and it's image point. The object's new origin point is (3,6), placing the image point (2,0) from that at (5,6) absolutely.

If it helps my #1 method for figuring out how exactly what some number means or what something does is to make a quick blank project with a sprite or two and a text object set to any/all values I'm interested in and just muck around until I understand what's going on.

In answer to your second question, yes it is possible but the math is more work than what I just did. You'll have to use more expression variables like sprite.Height and sprite.Width and resize things. If I have time I might be able to look at your capx later and advise you further but I don't know if I can.Phyvo2013-02-13 23:08:46