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(); }
public TileDrawAreaAction(TileLayer tileLayer, Point at, Size size, int[] setTo) : base(tileLayer) { this.size = size; this.setTo = setTo; this.CalculateForLocation(at); }
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); }
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]; }
public TileDrawAction(TileLayer tileLayer, Point at, int setTo) : base(tileLayer) { this.setTo = setTo; draw = new List<Point>(); draw.Add(at); was = new List<int>(); }
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; }
public TileSelectAction(TileLayer tileLayer, Rectangle selectArea) : base(tileLayer) { this.selectArea = selectArea; }
public TileMoveSelectionAction(TileLayer tileLayer, Point move) : base(tileLayer) { this.move = move; }
public TileFloodAction(TileLayer tileLayer, Point cell, int setTo) : base(tileLayer) { this.cell = cell; this.setTo = setTo; }
public TileRectangleAction(TileLayer tileLayer, Rectangle rect, int setTo) : base(tileLayer) { this.rect = rect; this.setTo = setTo; }
public TileClearSelectionAction(TileLayer tileLayer) : base(tileLayer) { }
public TileAction(TileLayer tileLayer) { TileLayer = tileLayer; }
public TileSetTilesetAction(TileLayer tileLayer, Tileset setTo) : base(tileLayer) { this.setTo = setTo; }
public TileDeleteSelectionAction(TileLayer tileLayer) : base(tileLayer) { }
public TileLayerEditor(LevelEditor levelEditor, TileLayer layer) : base(levelEditor, layer) { Layer = layer; }