Esempio n. 1
0
 private SpriteManager()
 {
     textureManager = TextureManager.Instance;
     sprites = new Dictionary<ESprite, KeyValuePair<Rectangle, TextureManager.ETexture>>();
     #region TETRIMINO_RECTANGLES
     sprites.Add(ESprite.Z, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(575,  345, 115, 115),  TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.T, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(0,    345, 115, 115),  TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.Q, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(230,  345, 115, 115),  TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.S, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(115,  345, 115, 115),  TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.L, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(345,  345, 115, 115),  TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.P, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(460,  345, 115, 115),  TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.O, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(690, 345, 115, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.PAUSE, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(0, 230, 115, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.LEFT, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(2 * 115, 2 * 115, 115, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.RIGHT, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(115, 2 * 115, 115, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.CLIMBYBLUE, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(3 * 115, 115, 115, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.CLIMBYRED, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(4 * 115, 115, 115, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.LEFT_TEXT_BUTTON, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(5 * 115, 115, 35, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.MIDDLE_TEXT_BUTTON, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(6 * 115, 2* 115, 53, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.RIGHT_TEXT_BUTTON, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(6 * 115, 115, 35, 115), TextureManager.ETexture.TETRIMINO));
     sprites.Add(ESprite.TUTORIAL_P1, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(0, 0, 1920, 1080), TextureManager.ETexture.TUTORIAL_P1));
     sprites.Add(ESprite.TUTORIAL_P2, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(0, 0, 1920, 1080), TextureManager.ETexture.TUTORIAL_P2));
     sprites.Add(ESprite.TUTORIAL_P3, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(0, 0, 1920, 1080), TextureManager.ETexture.TUTORIAL_P3));
     sprites.Add(ESprite.LOGO, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(0, 0, 1001, 402), TextureManager.ETexture.LOGO));
     sprites.Add(ESprite.NONE, new KeyValuePair<Rectangle, TextureManager.ETexture>(new Rectangle(690, 0, 115, 115), TextureManager.ETexture.TETRIMINO));
     #endregion
 }
Esempio n. 2
0
 internal void drawShapeAtPos(Vector2 pos, TextureManager.ETexture shape, float ort, float sprtSize, float transparency = 1f)
 {
     App.SpriteBatch.Draw(textureManager.getTexture(shape), new Vector2(pos.X + sprtSize / 2, pos.Y + sprtSize / 2), new Rectangle(0, 0, 800, 800), Color.White * transparency, ort, new Vector2(800 / 2f), sprtSize / 800, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0);
 }