Exemplo n.º 1
0
 public void Draw(Graphics graphics, Tileset tileset, LayerMode layerMode, TileRectangle sourceRect, int tileSize)
 {
     for (int y = 0; y <= sourceRect.Height; y++)
     {
         for (int x = 0; x <= sourceRect.Width; x++)
         {
             tileset.DrawTile(graphics, new TileLocation(x, y), upperLayer[x + sourceRect.X, y + sourceRect.Y], lowerLayer[x + sourceRect.X, y + sourceRect.Y], layerMode, tileSize);
         }
     }
 }
Exemplo n.º 2
0
 public static TileRectangle ScaleFromRectangle(Rectangle rect, int tileSize)
 {
     return(TileRectangle.FromLTRB(rect.Left / tileSize, rect.Top / tileSize, (rect.Right - 1) / tileSize, (rect.Bottom - 1) / tileSize));
 }
Exemplo n.º 3
0
 public static bool Equals(TileRectangle left, TileRectangle right)
 {
     return(left.x == right.x && left.y == right.y && left.width == right.width && left.height == right.height);
 }