Monday, February 1, 2010

Sprite class v2

The sprite class now has a rotation effect. Testing them together I have the sprite fading from 50 alpha to 255 alpha over 2 seconds, at the same time it is rotating counterclockwise by 180 degrees over 2 seconds.

This is the code being used to test the 2 effects together:

test = new Sprite(Content.Load("Sprites\\Statues"));
test.position = new Vector2(50.0f, 50.0f);
test.setTransparency(50);
test.beginFadeEffect(255.0f, 2000.0f);
test.beginRotationEffect(MathHelper.ToRadians(-180.0f), 2000.0f);

Here is a link to the sprite class:
http://pastebin.com/f68be73c6

No comments:

Post a Comment