private static void Editor_Tile_Attributes(byte x, byte y) { Editor_Tiles Objects = Editor_Tiles.Objects; Point Tile = new Point(Objects.scrlTileX.Value + x, Objects.scrlTileY.Value + y); Point Point = new Point(x * Globals.Grid + Globals.Grid / 2 - 5, y * Globals.Grid + Globals.Grid / 2 - 6); // Previne erros if (Tile.X > Lists.Tile[Objects.scrlTile.Value].Data.GetUpperBound(0)) { return; } if (Tile.Y > Lists.Tile[Objects.scrlTile.Value].Data.GetUpperBound(1)) { return; } // Desenha uma letra e colore o azulejo referente ao atributo switch ((Globals.Tile_Attributes)Lists.Tile[Objects.scrlTile.Value].Data[Tile.X, Tile.Y].Attribute) { case Globals.Tile_Attributes.Block: Render(Win_Tile, Tex_Blank, x * Globals.Grid, y * Globals.Grid, 0, 0, Globals.Grid, Globals.Grid, CColor(225, 0, 0, 75)); DrawText(Win_Tile, "B", Point.X, Point.Y, SFML.Graphics.Color.Red); break; } }
private void butTiles_Click(object sender, EventArgs e) { // Verifica se os diretórios foram selecionados if (string.IsNullOrEmpty(Lists.Options.Directory_Client)) { MessageBox.Show("Select the client directory."); } else { Editor_Tiles.Request(); } }
private static void Editor_Tile() { Editor_Tiles Objects = Editor_Tiles.Objects; // Somente se necessário if (!Objects.Visible) { return; } // Limpa a área com um fundo preto Win_Tile.Clear(SFML.Graphics.Color.Black); // Dados Texture Texture = Tex_Tile[Objects.scrlTile.Value]; Size Size = TSize(Texture); Point Point = new Point(Objects.scrlTileX.Value * Globals.Grid, Objects.scrlTileY.Value * Globals.Grid); // Desenha o azulejo e as grades Transparent(Win_Tile); Render(Win_Tile, Texture, new Rectangle(Point, Size), new Rectangle(new Point(0), Size)); for (byte x = 0; x <= Objects.picTile.Width / Globals.Grid; x++) { for (byte y = 0; y <= Objects.picTile.Height / Globals.Grid; y++) { // Desenha os atributos if (Objects.optAttributes.Checked) { Editor_Tile_Attributes(x, y); } // Bloqueios direcionais else if (Objects.optDirBlock.Checked) { Editor_Tile_DirBlock(x, y); } // Grades RenderRectangle(Win_Tile, x * Globals.Grid, y * Globals.Grid, Globals.Grid, Globals.Grid, CColor(25, 25, 25, 70)); } } // Exibe o que foi renderizado Win_Tile.Display(); }
private static void Editor_Tile_DirBlock(byte x, byte y) { Editor_Tiles Objects = Editor_Tiles.Objects; Point Tile = new Point(Objects.scrlTileX.Value + x, Objects.scrlTileY.Value + y); byte Y; // Previne erros if (Tile.X > Lists.Tile[Objects.scrlTile.Value].Data.GetUpperBound(0)) { return; } if (Tile.Y > Lists.Tile[Objects.scrlTile.Value].Data.GetUpperBound(1)) { return; } // Bloqueio total if (Lists.Tile[Objects.scrlTile.Value].Data[x, y].Attribute == (byte)Globals.Tile_Attributes.Block) { Editor_Tile_Attributes(x, y); return; } for (byte i = 0; i < (byte)Globals.Directions.Count; i++) { // Estado do bloqueio if (Lists.Tile[Objects.scrlTile.Value].Data[Tile.X, Tile.Y].Block[i]) { Y = 8; } else { Y = 0; } // Renderiza Render(Win_Tile, Tex_Directions, x * Globals.Grid + Globals.Block_Position(i).X, y * Globals.Grid + Globals.Block_Position(i).Y, i * 8, Y, 6, 6); } }