コード例 #1
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            MakeAllRGBTriplets(false);
            int start = widgetIndex;

            Makers.Label(this, "Background", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -60, -100);
            Makers.Label(this, "Button border", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, -60);
            Makers.Label(this, "Button highlight", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, -20);
            Makers.Label(this, "Button", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -40, 20);
            Makers.Label(this, "Active button", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, 60);

            for (int i = start; i < widgetIndex; i++)
            {
                // TODO: darken when inactive for sliders
                //((LabelWidget)widgets[i]).DarkenWhenInactive = true;
                widgets[i].TabSelectable = true;
            }

            Makers.Label(this, "Red", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 30, -130);
            Makers.Label(this, "Green", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 95, -130);
            Makers.Label(this, "Blue", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 160, -130);

            defIndex = widgetIndex;
            Makers.Button(this, "Default colours", 160, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 120);
            Makers.Button(this, "Back", 80, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 170);

            // TODO: sliders
            return;

            sliderIndex = widgetIndex;
            Makers.Slider(this, 100, 10, 30, 255, PackedCol.Red)
            .SetLocation(Anchor.Min, Anchor.Min, 5, 5);
            Makers.Slider(this, 100, 10, 30, 255, PackedCol.Green)
            .SetLocation(Anchor.Min, Anchor.Min, 5, 25);
            Makers.Slider(this, 100, 10, 30, 255, PackedCol.Blue)
            .SetLocation(Anchor.Min, Anchor.Min, 5, 45);
        }
コード例 #2
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            MakeStatus();

            textIndex = widgetIndex;
            Makers.Label(this, mainText, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -40);
            yesIndex = widgetIndex;
            Makers.Button(this, "Yes", 70, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, 45);
            noIndex = widgetIndex;
            Makers.Button(this, "No", 70, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, 45);

            cancelIndex = widgetIndex;
            Makers.Button(this, "Cancel", 120, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 45);
            sliderIndex = widgetIndex;
            Makers.Slider(this, 200, 10, 0, 100, progFront)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 15);
        }