Pivot position

how to get pivot value?

I'm pretty sure what you're talking about is the rotation position. To get the rotation position, just do this
untitled script pic
untitled script pic (34)

Just keep in mind that they report the position on the stage, not relative to the sprite.

yep, i tried them, not what i want, lets say we have 100x100 sprite, and i placed pivot in (-30, -30), so pivot would be 20, 20 towards width and height

It is what you want, it's just not relative to the sprite center. To get it to be relative to the sprite center, just do this

untitled script pic (35)

it returns 0.5?

That's if the rotation is 0.5 (pixels? idk what snap uses for it's coordinate system) away from the center

idk why snap calls it pivot in the context menu, because it's really just the rotation position.

but it also changes its x y visually

I should've asked you this before, what do you mean by pivot? Are you talking about the option the context menu when you right click on a sprite on the stage?

yes

well, that's what I've been talking about. The pivot option just changes the rotation x and y.

In the costume editor, you can easily see the pivot:

This is the result if the sprite goto (0,0) with this pivot:
image

If the sprite turn 90 deg to the right, watch the result:
image

When you manually set the pivot to (x,y), this position is not relative to the sprite but to the stage:

if the sprite turn, it turn around this pivot:
image

You can set the pivot like this:
image

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.