コード例 #1
1
ファイル: TileCanvas.cs プロジェクト: hach-que/OgmoEditor
        public TileCanvas(TileLayer tileLayer)
        {
            TileLayer = tileLayer;

            //Init the textures array
            Size texSize = new Size(MAX_TEXTURE_SIZE - (MAX_TEXTURE_SIZE % TileLayer.Definition.Grid.Width), MAX_TEXTURE_SIZE - (MAX_TEXTURE_SIZE % TileLayer.Definition.Grid.Height));

            Size maxSize = new Size(TileLayer.Definition.Grid.Width * TileLayer.TileCellsX, TileLayer.Definition.Grid.Height * TileLayer.TileCellsY);

            // TODO: Clip the dimensions of the tiles that draw over the edges of the level.
            Textures = new List<TextureInfo>();
            for (int i = 0; i < maxSize.Width; i += texSize.Width)
            {
                for (int j = 0; j < maxSize.Height; j += texSize.Height)
                {
                    RenderTarget2D tex = new RenderTarget2D(
                        Ogmo.EditorDraw.GraphicsDevice,
                        Math.Min(maxSize.Width - i, texSize.Width),
                        Math.Min(maxSize.Height - j, texSize.Height));
                    Textures.Add(new TextureInfo(tex, new Point(i, j)));
                }
            }

            RefreshAll();
        }
コード例 #2
0
        public TileDrawAreaAction(TileLayer tileLayer, Point at, Size size, int[] setTo)
            : base(tileLayer)
        {
            this.size = size;
            this.setTo = setTo;

            this.CalculateForLocation(at);
        }
コード例 #3
0
        public TilePasteSelectionAction(TileLayer tileLayer, Rectangle area, int[,] data)
            : base(tileLayer)
        {
            newData = data;
            this.area = area;

            this.area.X = Math.Min(area.X, tileLayer.TileCellsX - area.Width);
            this.area.Y = Math.Min(area.Y, tileLayer.TileCellsY - area.Height);
        }
コード例 #4
0
        public TileClipboardItem(Rectangle area, TileLayer layer)
            : base()
        {
            Area = area;

            Data = new int[Area.Width, Area.Height];
            for (int i = 0; i < Area.Width; i++)
                for (int j = 0; j < Area.Height; j++)
                    Data[i, j] = layer.Tiles[i + Area.X, j + Area.Y];
        }
コード例 #5
0
ファイル: TileDrawAction.cs プロジェクト: hach-que/OgmoEditor
        public TileDrawAction(TileLayer tileLayer, Point at, int setTo)
            : base(tileLayer)
        {
            this.setTo = setTo;

            draw = new List<Point>();
            draw.Add(at);

            was = new List<int>();
        }
コード例 #6
0
ファイル: TileSelection.cs プロジェクト: hach-que/OgmoEditor
        public TileSelection(TileLayer layer, Rectangle area)
        {
            Layer = layer;
            Area = area;

            Under = new int[Math.Max(area.Width, 0), Math.Max(area.Height, 0)];
            for (int i = 0; i < area.Width; i++)
                for (int j = 0; j < area.Height; j++)
                    Under[i, j] = -1;
        }
コード例 #7
0
 public TileSelectAction(TileLayer tileLayer, Rectangle selectArea)
     : base(tileLayer)
 {
     this.selectArea = selectArea;
 }
コード例 #8
0
 public TileMoveSelectionAction(TileLayer tileLayer, Point move)
     : base(tileLayer)
 {
     this.move = move;
 }
コード例 #9
0
 public TileFloodAction(TileLayer tileLayer, Point cell, int setTo)
     : base(tileLayer)
 {
     this.cell = cell;
     this.setTo = setTo;
 }
コード例 #10
0
 public TileRectangleAction(TileLayer tileLayer, Rectangle rect, int setTo)
     : base(tileLayer)
 {
     this.rect = rect;
     this.setTo = setTo;
 }
コード例 #11
0
 public TileClearSelectionAction(TileLayer tileLayer)
     : base(tileLayer)
 {
 }
コード例 #12
0
ファイル: TileAction.cs プロジェクト: hach-que/OgmoEditor
 public TileAction(TileLayer tileLayer)
 {
     TileLayer = tileLayer;
 }
コード例 #13
0
 public TileSetTilesetAction(TileLayer tileLayer, Tileset setTo)
     : base(tileLayer)
 {
     this.setTo = setTo;
 }
コード例 #14
0
 public TileDeleteSelectionAction(TileLayer tileLayer)
     : base(tileLayer)
 {
 }
コード例 #15
0
 public TileLayerEditor(LevelEditor levelEditor, TileLayer layer)
     : base(levelEditor, layer)
 {
     Layer = layer;
 }