public void SelectGrid(LayMapTileGrid grid) { for (int i = 0; i < grid.Tiles.Count; i++) { ExtraTileInfo ti = (ExtraTileInfo)grid.Tiles[i].Tag; ti.Selected = true; } }
public void UnselectAllTiles() { for (int x = 0; x < Map.Size.Width; x++) { for (int y = 0; y < Map.Size.Height; y++) { ExtraTileInfo ti = (ExtraTileInfo)Map.Tiles[x, y].Tag; ti.Selected = false; } } }
public List <LayMapTile> GetSelectedTiles() { List <LayMapTile> res = new List <LayMapTile>(); for (int x = 0; x < Map.Size.Width; x++) { for (int y = 0; y < Map.Size.Height; y++) { ExtraTileInfo ti = (ExtraTileInfo)Map.Tiles[x, y].Tag; if (ti.Selected) { res.Add(Map.Tiles[x, y]); } } } return(res); }
// (2 * 4) * 8 = 64 // other possible: 1 (32) private void RenderMap() { if (m_Map == null) { return; } //OGLTexture txt = Textures.LoadTexture(EvilTools.GetExecutingPath(@"MapEditor\Tiles\22029.png")); int yStart = 0; int xStart = 0; xStart = GetPositionOnMap(m_PositionX); yStart = GetPositionOnMap(m_PositionY); for (int y = yStart; y < m_Map.Size.Height; y++) { if ((y * BoxSize) > oGL.Height + m_PositionY) { continue; } for (int x = xStart; x < m_Map.Size.Width; x++) { if ((x * BoxSize) > oGL.Width + m_PositionX) { continue; } LayMapTile tile = m_Map.Tiles[x, y]; ExtraTileInfo info = (ExtraTileInfo)tile.Tag; OGLTools.DrawTexture(info.Texture, new Position2D(0, 0), new Dimension2D(info.Texture.Size.Width, info.Texture.Size.Height), new Position2D((x * BoxSize) - m_PositionX, (y * BoxSize) - m_PositionY), new Dimension2D(BoxSize, BoxSize), 1f); } } }