Ejemplo n.º 1
0
        // TileLib
        public void DefaultTileLib()
        {
            int cellWidth  = defaultTileWidth;;
            int cellHeight = defaultTileHeight;

            hScrollBarTileLib.Value   = 0;
            hScrollBarTileLib.Maximum = 0;
            vScrollBarTileLib.Value   = 0;
            vScrollBarTileLib.Maximum = 0;

            textBoxCustomTileWidth.Text  = cellWidth.ToString();
            textBoxCustomTileHeight.Text = cellHeight.ToString();

            textBoxCustomTileWidth.StoreText();
            textBoxCustomTileHeight.StoreText();

            try
            {
                tileLibs.Clear();
            }
            catch
            {
            }

            currentTileLib = null;
            tileLibs       = new List <TileLib>();

            panelCustomTileWindow.Invalidate();
            panelCustomTileSelected.Invalidate();
        }
Ejemplo n.º 2
0
        private void buttonRemoveTileLib_Click(object sender, EventArgs e)
        {
            tileLibs.Remove(currentTileLib);

            currentTileLib = null;

            if (tileLibs.Count > 1)
            {
                textBoxCustomTileWidth.Text  = "";
                textBoxCustomTileHeight.Text = "";
            }

            panelCustomTileWindow.Invalidate();
            panelCustomTileLibList.Invalidate();
        }
Ejemplo n.º 3
0
        public void SelectTileLib(int index)
        {
            SubmitTileLibScrollBars();

            currentTileLib = tileLibs[index];

            hScrollBarTileLib.Maximum     = currentTileLib.hScrollMax;
            hScrollBarTileLib.LargeChange = currentTileLib.hScrollLargeChange;
            hScrollBarTileLib.Value       = currentTileLib.hScroll;

            vScrollBarTileLib.Maximum     = currentTileLib.vScrollMax;
            vScrollBarTileLib.LargeChange = currentTileLib.vScrollLargeChange;
            vScrollBarTileLib.Value       = currentTileLib.vScroll;

            panelCustomTileWindow.Invalidate();
        }
Ejemplo n.º 4
0
        public void LoadTileLib(string path)
        {
            int cellWidth  = int.Parse(textBoxCustomTileWidth.Text);
            int cellHeight = int.Parse(textBoxCustomTileHeight.Text);

            TileLib tileLib = new TileLib();

            tileLib.cellWidth     = cellWidth;
            tileLib.cellHeight    = cellHeight;
            tileLib.imageFileName = path;

            tileLib.Load(path);

            if (tileLib.loaded == 0)
            {
                tileLib = null;
                return;
            }

            tileLibs.Add(tileLib);

            currentTileLib = tileLib;

            hScrollBarTileLib.Maximum     = tileLib.columnCount - 1;
            hScrollBarTileLib.LargeChange = panelCustomTileWindow.Width / tileLib.cellWidth;
            hScrollBarTileLib.Value       = 0;

            vScrollBarTileLib.Maximum     = tileLib.rowCount - 1;
            vScrollBarTileLib.LargeChange = panelCustomTileWindow.Height / tileLib.cellHeight;
            vScrollBarTileLib.Value       = 0;

            vScrollBarTileLibList.Maximum     = tileLibs.Count - 1;
            vScrollBarTileLibList.LargeChange = panelCustomTileLibList.Height / this.FontHeight;
            vScrollBarTileLibList.Value       = 0;

            SubmitTileLibScrollBars();

            panelCustomTileLibList.Invalidate();
            panelCustomTileWindow.Invalidate();
        }