예제 #1
0
        public override void Paint(ICanvas canvas, ObjectLayer layer, Point paintLocation, int brushSizeX, int brushSizeY, int bank, int idx)
        {
            Tile target      = layer.Tiles[Program.ScreenPointToIndex(paintLocation)].Clone();
            Tile replacement = new Tile(bank, idx);

            Replace(layer, target, replacement);
        }
예제 #2
0
 public override void Paint(ICanvas canvas, ObjectLayer layer, Point paintLocation, int brushSizeX, int brushSizeY, int bank, int idx)
 {
     if (Source == null)
     {
         return;
     }
     Source.Paint(canvas, layer, paintLocation, brushSizeX, brushSizeY);
 }
예제 #3
0
 public Pattern(int layer, int width = Program.ScreenWidth, int height = Program.ScreenHeight, bool overwrite = false)
 {
     Width     = width;
     Height    = height;
     Overwrite = overwrite;
     Layers    = new Layer[8];
     for (int i = 0; i < 4; i++)
     {
         Layers[i] = new TileLayer(i, (i == layer));
     }
     for (int i = 4; i < 8; i++)
     {
         Layers[i] = new ObjectLayer(i, (i == layer));
     }
 }
예제 #4
0
 public override void Paint(ICanvas canvas, ObjectLayer layer, Point paintLocation, int brushSizeX, int brushSizeY, int bank, int idx)
 {
     for (int brushX = 0; brushX < brushSizeX; brushX++)
     {
         for (int brushY = 0; brushY < brushSizeY; brushY++)
         {
             int x = paintLocation.X + brushX;
             int y = paintLocation.Y + brushY;
             if (x < 0 || x >= Program.ScreenWidth || y < 0 || y >= Program.ScreenHeight)
             {
                 continue;
             }
             int i = Program.ScreenPointToIndex(x, y);
             layer.Tiles[i].Bank  = bank;
             layer.Tiles[i].Index = idx;
         }
     }
 }
예제 #5
0
        public void Paint(ICanvas canvas, ObjectLayer layer, Point paintLocation, int brushSizeX, int brushSizeY)
        {
            PatternType type = DeterminePatternType();

            if (type == PatternType.Empty || type == PatternType.SingleTileLayer)
            {
                return;
            }
            if (type == PatternType.Multilayer)
            {
                Paint(canvas, paintLocation, brushSizeX, brushSizeY);
                return;
            }
            for (int x = paintLocation.X; x < paintLocation.X + brushSizeX * Width; x += Width)
            {
                for (int y = paintLocation.Y; y < paintLocation.Y + brushSizeY * Height; y += Height)
                {
                    GetActiveLayer().CopyTo(layer, new Rectangle(0, 0, Width, Height), new Point(x, y), Overwrite);
                }
            }
        }
예제 #6
0
 abstract public void Paint(ICanvas canvas, ObjectLayer layer, Point paintLocation, int brushSizeX, int brushSizeY, int bank, int idx);