Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        //public delegate void IndexEvent(int tileIndex);
        //public event IndexEvent TileSelected;
        public TileSelector()
        {
            InitializeComponent();

            tileset = new TileSet();

            foregroundColor = Color.White;

            createTileSelectorDialog();
        }
Ejemplo n.º 3
0
        /* 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;
        }
Ejemplo n.º 4
0
        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);
                }
            }
        }