Example #1
0
        //Komenda tworząca guziki pod opcje.
        public void AddButtonsForOptions()
        {
            buttonsList = new CButton[5];
            Image saveIcon, loadIcon, helpIcon, quitIcon, clearIcon;

            //saveIcon = Image.CreateRectangle(32, 32, Color.Green);
            saveIcon = new Image("../../Assets/save_icon.png");
            saveIcon.SetPosition(4, topbarh / 2 + 10);
            CButton save = new CButton(4, topbarh / 2 + 10, 32, 32, 0);

            //loadIcon = Image.CreateRectangle(32, 32, Color.Orange);
            loadIcon = new Image("../../Assets/load_icon.png");
            loadIcon.SetPosition(4 + 32 + 4, topbarh / 2 + 10);
            CButton load = new CButton(4 + 32 + 4, topbarh / 2 + 10, 32, 32, 1);

            //helpIcon = Image.CreateRectangle(32, 32, Color.Blue);
            helpIcon = new Image("../../Assets/help_icon.png");
            helpIcon.SetPosition(4 + 32 + 4 + 32 + 4, topbarh / 2 + 10);
            CButton help = new CButton(4 + 32 + 4 + 32 + 4, topbarh / 2 + 10, 32, 32, 2);

            //quitIcon = Image.CreateRectangle(32, 32, Color.Red);
            quitIcon = new Image("../../Assets/quit_icon.png");
            quitIcon.SetPosition(4 + 32 + 4 + 32 + 4 + 32 + 4, topbarh / 2 + 10);
            CButton quit = new CButton(4 + 32 + 4 + 32 + 4 + 32 + 4, topbarh / 2 + 10, 32, 32, 3);

            //clearIcon = Image.CreateRectangle(32, 32, Color.White);
            clearIcon = new Image("../../Assets/clear2_icon.png");
            clearIcon.SetPosition(4 + 32 + 4 + 32 + 4 + 32 + 4 + 32 + 4, topbarh / 2 + 10);
            CButton clear = new CButton(4 + 32 + 4 + 32 + 4 + 32 + 4 + 32 + 4, topbarh / 2 + 10, 32, 32, 4);

            windowGraphics.Add(saveIcon);
            windowGraphics.Add(loadIcon);
            windowGraphics.Add(helpIcon);
            windowGraphics.Add(quitIcon);
            windowGraphics.Add(clearIcon);

            buttonsList[0] = save;
            buttonsList[1] = load;
            buttonsList[2] = help;
            buttonsList[3] = quit;
            buttonsList[4] = clear;


            hasButtons     = true;
            optionsButtons = true;
        }
Example #2
0
        //Komenda generująca guziki pod wybór tilesetu
        public void AddButtonsForTiles()
        {
            buttonsList = new CButton[Akcja.indexTiles];

            int x = 0, y = 0;

            for (int i = 0; i < Akcja.indexTiles; i++)
            {
                if (x == Akcja.indexX)
                {
                    x = 0;
                    y++;
                }
                CButton custom = new CButton(3 + x * 32, (int)mainbg.Y + 3 + y * 32, 32, 32, i);
                buttonsList[i] = custom;
                x++;
            }
            hasButtons   = true;
            tilesChooser = true;
        }