redefining a center point or pivot point

14 views
Skip to first unread message

tsturzl

unread,
Jan 19, 2011, 10:16:24 AM1/19/11
to Rabbyt
Hey I need to redefine a center point for the sprite so I can rotate
it around a certain point. My artist made arms to overlay the body and
they rotate to point to the mouse, problem is the shoulder, which
should be the pivot point, isn't on the center of the image, so once
you get about 70 degrees of rotation the shoulder wanders from its
position.

So is there a way to define another point for rotating around, or
redefining the center point. I remember doing something similar in
pygame, but I'm not sure how to do it in Rabbyt. Any ideas? Also if I
can redefine the center or a new pivot point while the coordinates be
in reference to the image or the screen?

Joseph Marshall

unread,
Jan 19, 2011, 12:14:23 PM1/19/11
to rab...@googlegroups.com
You can use the Sprite's `shape` attribute:

For instance the following shape would set the center of the sprite at the top middle: [-w/2, 0, w/2, h]


--
You received this message because you are subscribed to the Google Groups "Rabbyt" group.
To post to this group, send email to rab...@googlegroups.com.
To unsubscribe from this group, send email to rabbyt+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rabbyt?hl=en.


tsturzl

unread,
Jan 20, 2011, 2:04:50 PM1/20/11
to Rabbyt
Will this change the look of the sprite though, and will it allow me
to rotate the sprite around that point?

On Jan 19, 11:14 am, Joseph Marshall <marshallpeng...@gmail.com>
wrote:
> > rabbyt+un...@googlegroups.com<rabbyt%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages