rotation functioning in rectangle renderer.
This commit is contained in:
@@ -99,20 +99,22 @@ namespace CameraTest
|
||||
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
float angleDeg = 0;
|
||||
/// <summary>
|
||||
/// This is called when the game should draw itself.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
angleDeg++;
|
||||
if (angleDeg > 360) angleDeg = 0;
|
||||
GraphicsDevice.Clear(Color.Black);
|
||||
rr.Begin(true);
|
||||
rr.Draw(25, 25, 70, 70, Color.Purple);
|
||||
rr.End();
|
||||
|
||||
rr.Begin(false);
|
||||
rr.Draw(75, 75, 70, 70, Color.Green);
|
||||
rr.Draw(75, 75, 70, 70, Color.Green, MathHelper.ToRadians(angleDeg));
|
||||
rr.End();
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
|
Reference in New Issue
Block a user