private void LoadFile() { if (this.openFileDialog2.ShowDialog() != DialogResult.OK) { return; } GameEngine.Location loc = GameEngine.Location.Load(this.openFileDialog2.FileName); TileMap map = loc.Description as TileMap; if (map != null) { if (map.Sprite != null) { this.tSprite.Text = map.Sprite.Name; this.tTileWidth.Text = "" + map.Sprite.Width; this.tTileHeight.Text = "" + map.Sprite.Height; //isSpriteLoaded = true; } this.tWidth.Text = "" + map.Width; this.tHeight.Text = "" + map.Height; this.location = loc; this.panel1.Refresh(); this.pTilePreview.Refresh(); } }
public Form1() { InitializeComponent(); this.anyChanges = false; tile = 0; this.buffer = BitmapExtensions.CreateBitmap(this.Width, this.Height); this.gfx = Graphics.FromImage(buffer); this.drawer = new Drawer2D(); this.location = new GameEngine.Location(new TileMap(null, int.Parse(this.tWidth.Text), int.Parse(this.tHeight.Text))); }