예제 #1
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(150, 105);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            invert = new Button(5, 80, (int)size.X - 10, 20, "Invert");
            invert.onClicked += new Button.ClickedEventHandler(invert_onClicked);
            controls.Add(invert);

            base.Initialize();
        }
예제 #2
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(180, 150);

            title      = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground    = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable                   = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground        = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Luminosity:");

            l.foreground = Color.White;
            controls.Add(l);

            luminosity               = new TextBox(125, 80, (int)size.X - 130, 20);
            luminosity.MaxLength     = 5;
            luminosity.Multiline     = false;
            luminosity.Mask          = TextBox.InputMask.Numbers;
            luminosity.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(luminosity);

            l            = new Label(5, 105, "Color: ");
            l.foreground = Color.White;
            controls.Add(l);

            color            = new MicroWorld.Graphics.GUI.Elements.Button(125, 105, (int)size.X - 130, 20, "");
            color.onClicked += new MicroWorld.Graphics.GUI.Elements.Button.ClickedEventHandler(color_onClicked);
            controls.Add(color);

            l            = new Label(5, 130, "Brightness: ");
            l.foreground = Color.White;
            controls.Add(l);

            brightness               = new Label(5, 130, "");
            brightness.foreground    = Color.White;
            brightness.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(brightness);

            base.Initialize();
        }
예제 #3
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(180, 150);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Luminosity:");
            l.foreground = Color.White;
            controls.Add(l);

            luminosity = new TextBox(125, 80, (int)size.X - 130, 20);
            luminosity.MaxLength = 5;
            luminosity.Multiline = false;
            luminosity.Mask = TextBox.InputMask.Numbers;
            luminosity.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(luminosity);

            l = new Label(5, 105, "Color: ");
            l.foreground = Color.White;
            controls.Add(l);

            color = new MicroWorld.Graphics.GUI.Elements.Button(125, 105, (int)size.X - 130, 20, "");
            color.onClicked += new MicroWorld.Graphics.GUI.Elements.Button.ClickedEventHandler(color_onClicked);
            controls.Add(color);

            l = new Label(5, 130, "Brightness: ");
            l.foreground = Color.White;
            controls.Add(l);

            brightness = new Label(5, 130, "");
            brightness.foreground = Color.White;
            brightness.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(brightness);

            base.Initialize();
        }
예제 #4
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(220, 130);

            title      = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground    = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable                   = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground        = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Max resistance:");

            l.foreground = Color.White;
            controls.Add(l);

            resistance               = new TextBox(145, 80, (int)size.X - 150, 20);
            resistance.MaxLength     = 7;
            resistance.Multiline     = false;
            resistance.Mask          = TextBox.InputMask.Numbers;
            resistance.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(resistance);

            loadSeq            = new MicroWorld.Graphics.GUI.Elements.Button(5, 105, (int)size.X - 10, 20, "Load sequence");
            loadSeq.onClicked += new MicroWorld.Graphics.GUI.Elements.Button.ClickedEventHandler(loadSeq_onClicked);
            controls.Add(loadSeq);

            base.Initialize();
        }
예제 #5
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(220, 130);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Max resistance:");
            l.foreground = Color.White;
            controls.Add(l);

            resistance = new TextBox(145, 80, (int)size.X - 150, 20);
            resistance.MaxLength = 7;
            resistance.Multiline = false;
            resistance.Mask = TextBox.InputMask.Numbers;
            resistance.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(resistance);

            loadSeq = new MicroWorld.Graphics.GUI.Elements.Button(5, 105, (int)size.X - 10, 20, "Load sequence");
            loadSeq.onClicked += new MicroWorld.Graphics.GUI.Elements.Button.ClickedEventHandler(loadSeq_onClicked);
            controls.Add(loadSeq);

            base.Initialize();
        }
예제 #6
0
        public override void Initialize()
        {
            ShouldBeScaled = false;

            back = new EncyclopediaBrowserButton(670, 15, 120, 30, "Back");
            back.onClicked += new Button.ClickedEventHandler(back_onClicked);
            back.foreground = Color.White;
            (back as EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            controls.Add(back);

            for (int i = 0; i < tabs.Length; i++)
            {
                tabs[i] = new LevelSelectorTabsButton(15 + i * 130, 15, 120, 30, TABS_NAMES[i]);
                tabs[i].onClicked += new Button.ClickedEventHandler(Tabs_onClicked);
                tabs[i].foreground = Color.White;
                (tabs[i] as EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
                controls.Add(tabs[i]);
            }

            //int w = (int)((Main.WindowWidth - 1) / levels.GetLength(0)),//why 1?
            //    h = (int)((Main.WindowHeight - 50) / levels.GetLength(1));
            int d = 0;
            for (int x = 0; x < levels.GetLength(0); x++)
            {
                if (x > 3) d = 16;
                for (int y = 0; y < levels.GetLength(1); y++)
                {
                    levels[x, y] = new LevelSelectorButton(16 + x * 96 + d, 54 + y * 90, 80, 80, (y * levels.GetLength(0) + x).ToString());
                    levels[x, y].Font = ResourceManager.Load<SpriteFont>("Fonts/LevelSelectorButtonFont");
                    levels[x, y].LoadImages("GUI/Menus/LevelSelector/Button", "GUI/Menus/LevelSelector/ButtonOver", "GUI/Menus/LevelSelector/ButtonSelected");
                    levels[x, y].onClicked += new Button.ClickedEventHandler(Levels_onClicked);
                    controls.Add(levels[x, y]);
                }
            }

            CurTab = curTab;

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }