What Im trying to do is pretty simple, offset the rendering position of my image when scaled up/down. I honestly can't remember how to-do this :(
if (newAnim.texture != null)
{
// Set Source Rectangle
sourceRect.X = newAnim.imageRectArray[newAnim.CurrentFrame].X;
sourceRect.Y = newAnim.imageRectArray[newAnim.CurrentFrame].Y;
sourceRect.Width = newAnim.imageRectArray[newAnim.CurrentFrame].Width;
sourceRect.Height = newAnim.imageRectArray[newAnim.CurrentFrame].Height;
// Get new center when scaled.
Vector2 center = new Vector2(
(newAnim.imageVector2Array[newAnim.CurrentFrame].X * scale) / 2,
(newAnim.imageVector2Array[newAnim.CurrentFrame].Y * scale) / 2
);
// Only Render if we have Something to use
if (newAnim.CurrentFrame >= 0)
spriteBatch.Draw(
newAnim.texture, new Vector2(100, 100), sourceRect,
Color.White, 0f, center, 1f, SpriteEffects.None, 0f
);
I'm unsure what I need to do to the Vector2. Hopefully getting the center/origin position is correct? I think so.
Edit:
http://dl.dropbox.com/u/13874083/screenshots/screen120107-160918.png
The bigger image is the scaled image (pretty obvious :P), but both are rendered at 100, 100.
