Exemplo n.º 1
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     int offset = (int)Math.Floor(timer);
     Vector2 pos = Room.TileToWorldPos(x, y);
     Vector2 offsetPos = new Vector2(0f, offset);
     Rectangle source = new Rectangle(offset, 0, Tile.tileSize - offset, Tile.tileSize - offset);
     main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
     offsetPos = new Vector2(0f, 0f);
     source = new Rectangle(offset, Tile.tileSize - offset, Tile.tileSize - offset, offset);
     main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
     offsetPos = new Vector2(Tile.tileSize - offset, offset);
     source = new Rectangle(0, 0, offset, Tile.tileSize - offset);
     main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
     offsetPos = new Vector2(Tile.tileSize - offset, 0f);
     source = new Rectangle(0, Tile.tileSize - offset, offset, offset);
     main.spriteBatch.Draw(texture, screen.DrawPos(main, pos + offsetPos), source, Color.White);
 }
Exemplo n.º 2
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     Texture2D texture;
     if (!textures.TryGetValue(direction, out texture))
     {
         texture = textures[Direction.Left];
     }
     main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White);
 }
Exemplo n.º 3
0
 public override void Draw(GameScreen screen, Main main)
 {
     Color color = Color.White;
     if (IsHurt)
     {
         color *= 0.75f;
     }
     main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, color, texture.Center());
 }
Exemplo n.º 4
0
 public override void Draw(GameScreen screen, Main main)
 {
     for (int k = 0; k < numBullets; k++)
     {
         float angle = rotation + 2f * k / numBullets * (float)Math.PI;
         Vector2 pos = center + radius * Helper.AngleToVector2(angle);
         main.spriteBatch.Draw(texture, screen.DrawPos(main, pos), null, color, texture.Center());
     }
 }
Exemplo n.º 5
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     Texture2D texture = closedTexture;
     if (open)
     {
         texture = vertical ? openVerticalTexture : openHorizontalTexture;
     }
     main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White);
 }
Exemplo n.º 6
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     Vector2 drawPos = screen.DrawPos(main, Room.TileToWorldPos(x, y));
     Rectangle frame = new Rectangle(0, 0, Tile.tileSize, Tile.tileSize);
     if (right)
     {
         frame.X = Tile.tileSize;
     }
     if (bottom)
     {
         frame.Y = Tile.tileSize;
     }
     main.spriteBatch.Draw(texture, drawPos, frame, Color.White, Vector2.Zero);
 }
Exemplo n.º 7
0
 public override void Draw(GameScreen screen, Main main)
 {
     main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White, texture.Center());
 }
Exemplo n.º 8
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     Texture2D texture = light ? onTexture : offTexture;
     main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(x, y)), null, Color.White);
 }
Exemplo n.º 9
0
 public override void Draw(GameScreen screen, Main main)
 {
     Texture2D texture = timeLeft > 0 ? warningTexture : pillarTexture;
     Vector2 drawPos = screen.DrawPos(main, Room.TileToWorldPos(x, y));
     main.spriteBatch.Draw(texture, drawPos, Color.White);
 }
Exemplo n.º 10
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     main.spriteBatch.Draw(texture, screen.DrawPos(main, Room.TileToWorldPos(new Vector2(x + 0.5f, y + 0.5f))),
         null, Color.White, texture.Center());
 }
Exemplo n.º 11
0
 public override void Draw(GameScreen screen, Main main)
 {
     main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, Color.White,
         Helper.Vector2ToAngle(velocity), texture.Center(), 1f, SpriteEffects.None, 1f);
 }
Exemplo n.º 12
0
 public override void Draw(GameScreen screen, int x, int y, Main main)
 {
     Texture2D text = pressed ? texturePressed : texture;
     main.spriteBatch.Draw(text, screen.DrawPos(main, Room.TileToWorldPos(x, y) + new Vector2(10f)), null, Color.White); 
 }
Exemplo n.º 13
0
 public override void Draw(GameScreen screen, Main main)
 {
     main.spriteBatch.Draw(texture, screen.DrawPos(main, position), null, color, rotation, texture.Center(),
         scale, SpriteEffects.None, 0f);
 }