Пример #1
0
        public AUI_Slider_Horizontal(int X, int Y)
        {
            bkgLineWindow = new AUI_Window(X, Y, Width, 4);
            bkgLineWindow.rec_bkg.color  = Assets.ForegroundColor;
            bkgLineWindow.rec_fore.color = Assets.BackgroundColor;

            text = new AUI_Text("0.15",
                                X + 16 * 9 + 6, Y - 10, Assets.ForegroundColor);
            text.color = Assets.ForegroundColor;
            text.font  = Assets.font;

            //this is what user clicks left/right of
            handle = new Int4(X, Y - 6, 4, 16);
            //this is what controls the clickable area
            hitbox = new Int4(X, Y - 10, Width, 24);
            //this gives user feedback they clicked somewhere
            clickLine = new Int4(X, Y - 3, 1, 10);

            //inits slider to start 0
            clickX = X + 4;
            //inits slider to end 1.0 max
            //clickX = X + Width - 8;

            displayState = DisplayState.Closed;
        }
Пример #2
0
        public Screen_StressTest()
        {
            aui_instances = new List <AUI_Base>();

            button_back = new AUI_Button(
                16 * 3, 16 * 2 + 8, 16 * 3, "< to title");
            button_back.CenterText();
            aui_instances.Add(button_back);

            timer_text = new AUI_Text("time",
                                      16 * 6 + 8, 16 * 2 + 5,
                                      Microsoft.Xna.Framework.Color.White);
            aui_instances.Add(timer_text);

            int g = 0; //counter/id

            for (int x = 0; x < 28; x++)
            {
                for (int y = 0; y < 16; y++)
                {
                    AUI_Button button = new AUI_Button(
                        48 + (x * 25), //x
                        64 + (25 * y), //y
                        24,            //width
                        "" + g);       //title
                    button.CenterText();
                    button.draggable = true;
                    aui_instances.Add(button);
                    g++;
                }
            }
        }
Пример #3
0
        public AUI_Button(int X, int Y, int W, string Text)
        {
            color_over        = Assets.OverColor;
            color_normal      = Assets.ForegroundColor;
            color_over_text   = Assets.OverColor;
            color_normal_text = Assets.TextColor;

            window = new AUI_Window(X, Y, W, 16);
            window.rec_bkg.color  = color_normal;
            window.rec_fore.color = Assets.BackgroundColor;
            text = new AUI_Text(Text,
                                X, Y, new Color(255, 255, 255, 0));
            displayState = DisplayState.Closed;
        }
Пример #4
0
        public Screen_Radial()
        {
            aui_instances = new List <AUI_Base>();

            button_back = new AUI_Button(
                16 * 3, 16 * 2 + 8, 16 * 3, "< to title");
            button_back.CenterText();
            aui_instances.Add(button_back);

            int btnWidth = 16 * 5;

            //left set
            radial_TopLeft         = new AUI_ButtonWithLine(-256, -256, btnWidth, "btn a");
            radial_TopLeft.offsetX = btnWidth;
            radial_TopLeft.offsetY = 8;
            aui_instances.Add(radial_TopLeft);

            radial_MidLeft         = new AUI_ButtonWithLine(-256, -256, btnWidth, "btn b");
            radial_MidLeft.offsetX = btnWidth;
            radial_MidLeft.offsetY = 8;
            aui_instances.Add(radial_MidLeft);

            radial_BotLeft         = new AUI_ButtonWithLine(-256, -256, btnWidth, "btn c");
            radial_BotLeft.offsetX = btnWidth;
            radial_BotLeft.offsetY = 8;
            aui_instances.Add(radial_BotLeft);

            //right set
            radial_TopRight         = new AUI_ButtonWithLine(-256, -256, btnWidth, "btn d");
            radial_TopRight.offsetX = 0;
            radial_TopRight.offsetY = 8;
            aui_instances.Add(radial_TopRight);

            radial_MidRight         = new AUI_ButtonWithLine(-256, -256, btnWidth, "btn e");
            radial_MidRight.offsetX = 0;
            radial_MidRight.offsetY = 8;
            aui_instances.Add(radial_MidRight);

            radial_BotRight         = new AUI_ButtonWithLine(-256, -256, btnWidth, "btn f");
            radial_BotRight.offsetX = 0;
            radial_BotRight.offsetY = 8;
            aui_instances.Add(radial_BotRight);

            introText = new AUI_Text(
                "press and hold spacebar to open the radial menu",
                16 * 7, 16 * 2 + 8, Assets.TextColor);
            aui_instances.Add(introText);
        }
Пример #5
0
        public Screen_Title()
        {
            aui_instances = new List <AUI_Base>();

            button_screen1 = new AUI_Button(
                16 * 8, 16 * 20, 16 * 5, "crown example");
            button_screen1.CenterText();
            aui_instances.Add(button_screen1);

            button_screen2 = new AUI_Button(
                16 * 15, 16 * 20, 16 * 5, "stress test");
            button_screen2.CenterText();
            aui_instances.Add(button_screen2);

            button_screen3 = new AUI_Button(
                16 * 22, 16 * 20, 16 * 5, "spider game");
            button_screen3.CenterText();
            aui_instances.Add(button_screen3);

            button_screen4 = new AUI_Button(
                16 * 29, 16 * 20, 16 * 5, "example 4");
            button_screen4.CenterText();
            aui_instances.Add(button_screen4);

            button_screen5 = new AUI_Button(
                16 * 36, 16 * 20, 16 * 5, "example 5");
            button_screen5.CenterText();
            aui_instances.Add(button_screen5);

            titleText = new AUI_Text("grak's aui lab",
                                     16 * 8, 16 * 5, Assets.ForegroundColor);
            titleText.scale = 10.0f;
            aui_instances.Add(titleText);

            descText = new AUI_Text(
                "this monogame laboratory showcases a variety of animated ui." +
                "\nclick a button below to see an example.",
                16 * 8, 16 * 14, Assets.ForegroundColor);
            descText.scale = 2.0f;
            aui_instances.Add(descText);

            AUI_LineWithRecs line0 = new AUI_LineWithRecs();

            line0.MoveTo(16 * 8, 16 * 6);
            line0.SetTarget(16 * 41, 16 * 6);
            line0.line.speedOpen   = 25;
            line0.line.speedClosed = 25;
            aui_instances.Add(line0);

            AUI_LineWithRecs line1 = new AUI_LineWithRecs();

            line1.MoveTo(16 * 8, 16 * 13);
            line1.SetTarget(16 * 41, 16 * 13);
            line1.line.speedOpen   = 20;
            line1.line.speedClosed = 25;
            aui_instances.Add(line1);

            AUI_LineWithRecs line2 = new AUI_LineWithRecs();

            line2.MoveTo(16 * 8, 16 * 18);
            line2.SetTarget(16 * 41, 16 * 18);
            line2.line.speedOpen   = 15;
            line2.line.speedClosed = 20;
            aui_instances.Add(line2);

            AUI_LineWithRecs line3 = new AUI_LineWithRecs();

            line3.MoveTo(16 * 8, 16 * 23);
            line3.SetTarget(16 * 41, 16 * 23);
            line3.line.speedOpen   = 10;
            line3.line.speedClosed = 20;
            aui_instances.Add(line3);
        }