public void load(Tilemap t) { this.t = t; t.render(); this.tileSize = 8; this.bufferHeight = t.height; this.bufferWidth = t.width; this.Size = this.MinimumSize = new Size(bufferWidth * tileSize, bufferHeight * tileSize); undobutton.Click += new EventHandler(Undo); redobutton.Click += new EventHandler(Redo); }
private void editSelectedBG() { if (tilesetListBox.SelectedItem == null) { return; } Tilemap t = getTilemap(); if (t == null) { return; } t.render(); new TilemapEditorWindow(t).Show(); }
private void exportPNGButton_Click(object sender, EventArgs e) { Tilemap t = getTilemap(); if (t == null) { return; } SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = LanguageManager.Get("Filters", "png"); if (sfd.ShowDialog() != DialogResult.OK) { return; } t.render(); t.buffer.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Png); }
private Bitmap RenderBackground(File GFXFile, File PalFile, File LayoutFile, int offs, int palOffs) { LayoutFile = new LZFile(LayoutFile, LZFile.CompressionType.LZ); PalFile = new LZFile(PalFile, LZFile.CompressionType.LZ); Image2D i = new Image2D(GFXFile, 256, false); Palette pal1 = new FilePalette(new InlineFile(PalFile, 0, 512, PalFile.name)); Palette pal2 = new FilePalette(new InlineFile(PalFile, 512, 512, PalFile.name)); Tilemap t = new Tilemap(LayoutFile, 64, i, new Palette[] { pal1, pal2 }, offs, palOffs); t.render(); return t.buffer; }