Пример #1
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++;
                }
            }
        }
Пример #2
0
 public AUI_ButtonWithLine(int X, int Y, int W, string Txt)
 {
     button = new AUI_Button(X, Y, W, Txt);
     button.displayState = DisplayState.Closed;
     line = new AUI_LineWithRecs();
     line.displayState = DisplayState.Closed;
 }
Пример #3
0
        public Screen_Example()
        {
            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);
        }
Пример #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_Spider()
        {
            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);

            /*
             * for(int x = 0; x < 9; x++)
             * {
             *  for (int y = 0; y < 1; y++)
             *  {
             *      //create test spider button
             *      AUI_SpiderQueenButton spiderQueen =
             *          new AUI_SpiderQueenButton(
             *              16 * 5 + ((16 * 4 + 6) * x),
             *              16 * 17 + (16 * 4 * y),
             *              "test", aui_instances);
             *      aui_instances.Add(spiderQueen);
             *  }
             * }
             */


            //single
            AUI_SpiderQueenButton test =
                new AUI_SpiderQueenButton(
                    16 * 22, 16 * 18, "hmm...", aui_instances);

            aui_instances.Add(test);


            /*
             * AUI_LineWithRecs line0 = new AUI_LineWithRecs();
             * line0.MoveTo(16 * 5, 16 * 15);
             * line0.SetTarget(16 * 45, 16 * 15);
             * aui_instances.Add(line0);
             *
             * AUI_LineWithRecs line1 = new AUI_LineWithRecs();
             * line1.MoveTo(16 * 5, 16 * 20);
             * line1.SetTarget(16 * 45, 16 * 20);
             * aui_instances.Add(line1);
             */
        }
Пример #6
0
        public AUI_SpiderQueenButton(int X, int Y,
                                     String Text, List <AUI_Base> LR)
        {
            button = new AUI_Button(X, Y, 16 * 4, Text);
            button.CenterText();

            lines = new List <AUI_Line>();
            //create 8 legs, update will match their positions
            for (i = 0; i < 8; i++)
            {
                AUI_Line line = new AUI_Line();
                line.displayState = DisplayState.Closed;
                lines.Add(line);
            }
            displayState = DisplayState.Closed;
            ListRef      = LR;
        }
Пример #7
0
        public Screen_Example1()
        {
            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);

            //add some crown buttons for testing
            for (int g = 0; g < 5; g++)
            {
                AUI_CrownButton crown = new AUI_CrownButton(
                    16 * 6 + (g * 120), //x
                    (16 * 22),          //y
                    16 * 2 + 16 * g,    //width
                    "test " + g);       //title

                //animate kids, except last one
                crown.wiggleChildren = true;
                if (g == 5)
                {
                    crown.wiggleChildren = false;
                }
                aui_instances.Add(crown);
            }


            //add some sliders for testing
            for (int g = 0; g < 5; g++)
            {
                AUI_Slider_Horizontal slider =
                    new AUI_Slider_Horizontal(
                        16 * 6 + (g * 120),
                        (16 * 7));
                slider.Open(g * 0.2f);
                //make the last few sliders display as float (not percentage)
                if (g > 2)
                {
                    slider.valueType = SliderValueType.Float;
                }
                aui_instances.Add(slider);
            }
        }
Пример #8
0
        public AUI_CrownButton(int X, int Y, int W, string Title)
        {
            button = new AUI_Button(
                X, Y, W, Title);
            button.CenterText();

            //setup crown children
            aui_crown_children  = new List <AUI_ButtonWithLine>();
            button_crown_child1 = new AUI_ButtonWithLine(0, 0, 16 * 4, "test a");
            button_crown_child1.line.line.animType = LineAnimType.Reverse;
            button_crown_child1.button.draggable   = true;
            aui_crown_children.Add(button_crown_child1);

            button_crown_child2 = new AUI_ButtonWithLine(0, 0, 16 * 4, "test b");
            button_crown_child2.line.line.animType = LineAnimType.Reverse;
            button_crown_child2.button.draggable   = true;
            aui_crown_children.Add(button_crown_child2);

            button_crown_child3 = new AUI_ButtonWithLine(0, 0, 16 * 4, "test c");
            button_crown_child3.line.line.animType = LineAnimType.Reverse;
            button_crown_child3.button.draggable   = true;
            aui_crown_children.Add(button_crown_child3);

            button_crown_child4 = new AUI_ButtonWithLine(0, 0, 16 * 4, "test d");
            button_crown_child4.line.line.animType = LineAnimType.Reverse;
            button_crown_child4.button.draggable   = true;
            aui_crown_children.Add(button_crown_child4);

            button_crown_child5 = new AUI_ButtonWithLine(0, 0, 16 * 4, "test e");
            button_crown_child5.line.line.animType = LineAnimType.Reverse;
            button_crown_child5.button.draggable   = true;
            aui_crown_children.Add(button_crown_child5);

            button_crown_child6 = new AUI_ButtonWithLine(0, 0, 16 * 4, "test f");
            button_crown_child6.line.line.animType = LineAnimType.Reverse;
            button_crown_child6.button.draggable   = true;
            aui_crown_children.Add(button_crown_child6);

            //place crown children
            PlaceChildren();
            CloseChildren();
        }
Пример #9
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);
        }