public void AddTile(Tile t, float xOffset = 0, int yOffset = 0) { tiles.Add((Tile)t.Clone()); if (t.Width > profile.Width) { profile.Width = t.Width; } if (t.Height > profile.Height) { profile.Height = t.Height; } t.position.X = xOffset; t.position.Y = yOffset; }
public TileMap(Tile defaultTile, int width, int height, SpriteBatch sb = null) { this.width = width; this.height = height; this.data = new Tile[height, width]; for (int i = 0; i < height; i++) for (int j = 0; j < width; j++) { data[i, j] = (Tile)defaultTile.Clone(); data[i, j].position.Y = i * defaultTile.Height; data[i, j].position.X = j * defaultTile.Width; } this.sb = sb; this.mainTile = defaultTile; luaEvents = new Dictionary<string, List<LuaFunction>>(); }
public TileMap(Tile defaultTile, int width, int height, SpriteBatch sb = null) { this.width = width; this.height = height; this.data = new Tile[height, width]; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { data[i, j] = (Tile)defaultTile.Clone(); data[i, j].position.Y = i * defaultTile.Height; data[i, j].position.X = j * defaultTile.Width; } } this.sb = sb; this.mainTile = defaultTile; luaEvents = new Dictionary <string, List <LuaFunction> >(); }
public void AddTile(Tile t, float xOffset = 0, int yOffset = 0) { tiles.Add((Tile)t.Clone()); if (t.Width > profile.Width) profile.Width = t.Width; if (t.Height > profile.Height) profile.Height = t.Height; t.position.X = xOffset; t.position.Y = yOffset; }
public void AddObject(Tile t, Vector2 pos) { data[(int)pos.Y, (int)pos.X] = (Tile)t.Clone(); data[(int)pos.Y, (int)pos.X].position.X = pos.X * mainTile.Width; data[(int)pos.Y, (int)pos.X].position.Y = pos.Y * mainTile.Height; }
public void AddObject(Tile t, Vector2 pos) { data[(int)pos.Y, (int)pos.X] = (Tile)t.Clone(); data[(int)pos.Y, (int)pos.X].position.X = pos.X * mainTile.Width; data[(int)pos.Y, (int)pos.X].position.Y = pos.Y * mainTile.Height; }