public CMVPlayer() { InitializeComponent(); // Paint values drawArea = new Rectangle(0, 0, Width, Height); // Draw stage constants magenta = Color.FromArgb(255, 255, 0, 255); attributes = new ImageAttributes(); playTimer = new Timer(); playTimer.Interval = 1000 / 25; playTimer.Tick += new EventHandler(timerTick); DoubleBuffered = true; Reset(); cmv = new CMV(); tileset = new TileSet(); renderedTiles = new Dictionary<short, Bitmap>(); forceRedraw = true; }
//public delegate void IndexEvent(int tileIndex); //public event IndexEvent TileSelected; public TileSelector() { InitializeComponent(); tileset = new TileSet(); foregroundColor = Color.White; createTileSelectorDialog(); }
/* Private methods */ private void loadTileset() { tileset = new TileSet(Application.StartupPath + "/curses_800x600.png"); tileSelector.TileSet = tileset; tileSelector.ForegroundColor = CMVColours.LBLUE; tileSelector.BackgroundColor = CMVColours.BLACK; tileSelector.SelectedTile = 16; }
private void action_ChooseNewTileset(object sender, EventArgs e) { string filename; DialogResult result; TileSet target; openImageFileDialog.FileName = "tileset.bmp"; result = openImageFileDialog.ShowDialog(); if (result == DialogResult.OK) { filename = openImageFileDialog.FileName; try { target = new TileSet(filename); tileset = target; action_changeTileset(sender, e); } catch (Exception) { MessageBox.Show(this, "The selected tileset was unusable, try another one. Compatable tilesets should be 16x16 grids (256) of icons.", "Error processing tileset", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }