예제 #1
0
파일: Level.cs 프로젝트: yongyi781/CCTools
 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);
         }
     }
 }
예제 #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));
 }
예제 #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);
 }