Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- origin.X = SpriteTexture.Width / 2;
- origin.Y = SpriteTexture.Height / 2;
- screenpos.X = viewport.Width / 2;
- screenpos.Y = 120;
- protected override void Draw(GameTime gameTime)
- {
- graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
- Viewport viewport = graphics.GraphicsDevice.Viewport;
- Matrix cameraTransform = Matrix.Identity;
- // Rotation code
- //float radians = MathHelper.Pi;
- //cameraTransform = Matrix.CreateTranslation(-viewport.Width / 2, -viewport.Height / 2, 0)
- // * Matrix.CreateRotationZ(radians)
- // * Matrix.CreateTranslation(viewport.Width / 2, viewport.Height / 2, 0);
- // Reflection code
- cameraTransform = Matrix.CreateTranslation(0, -viewport.Height, 0) * Matrix.CreateReflection(new Plane(0, 1, 0, 0));
- //cameraTransform = Matrix.CreateReflection(new Plane(0, 1, 0, viewport.Height * .5f));
- spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend,
- null, null, null, null, cameraTransform);
- spriteBatch.Draw(SpriteTexture, screenpos, null, Color.White, 0,
- origin, 1.0f, SpriteEffects.FlipVertically, 0f);
- spriteBatch.End();
- base.Draw(gameTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement