gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > the centerpoint of Rotating Sprites

#5667 - jenswa - Mon May 05, 2003 7:25 pm

I've have some sprites, which i am rotating, but they seem
to be rotated from the center of the sprites.

So if it's a square sprite from 16x16, like mine, the rotating center
is: 8,8, which is the middle/center point.

Now my question, is there a way to change this center point?

Apart from withdrawing my sprite in greater sprite dimensions
and adjusting the centerpoint by a lot of transparent pixels.
_________________
It seems this wasn't lost after all.

#5670 - tepples - Mon May 05, 2003 7:41 pm

jenswa wrote:
I've have some sprites, which i am rotating, but they seem
to be rotated from the center of the sprites.

To rotate a sprite around a point other than its center, move the sprite a few pixels as you rotate it. Likewise, to rotate a background around a point other than its upper-left corner, scroll the background (by changing the layer's x_origin and y_origin) as you rotate it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.