Esempio n. 1
0
    private void nextTile()
    {
        if (curTitle >= Titles.Count)
        {
            Log.Error("Nope");
            return;
        }


        titleEnd = Game.Time + TitleTime;
        if (curSprites.Count > 0)
        {
            for (int i = 0; i < 8; i++)
            {
                ui.RemoveChild(curSprites[i]);
            }


            curSprites.Clear();
//			ui.RemoveChild(curWid);
        }


        string img_file = Titles[curTitle];

//	Image i1 = new Image(img_file);

        Log.Message("Title:" + img_file);

        float ang = 0;

        for (int i = 0; i < 8; i++)
        {
            float mx = Unigine.MathLib.Cos(ang) * 80;
            float my = Unigine.MathLib.Sin(ang) * 80;



            WidgetLabel s1 = new WidgetLabel(ui, img_file);
            s1.SetPosition(200 + (int)mx, 200 + (int)my);
            s1.Width  = 512;
            s1.Height = 128;

            //int sc = Gui.BLEND_ONE;

            //	s1.SetBlendFunc(sc,Unigine.Gui.BLEND_ONE_MINUS_SRC_ALPHA);
            //		s1.SetLayerBlendFunc(0,sc, Unigine.Gui.BLEND_ONE_MINUS_SRC_ALPHA);
            ui.AddChild(s1, Gui.ALIGN_OVERLAP | Gui.ALIGN_FIXED);

            ang = ang + 45;

            curSprites.Add(s1);
        }


        //curWid = s1;


        curTitle++;
    }
Esempio n. 2
0
        //int onButtonCloseClicked();
        //int onButtonFopenClicked();
        //int onButtonWloadClicked();
        //int onDlgCancelClicked();
        //int onDlgOKClicked();
        //int onMeshParamsOKClicked();
        //int onSliderChanged();

        public int InitGUI()
        {
            gui          = Gui.get();
            widget_label = new WidgetLabel(gui, "sun position");
            widget_label.setToolTip("Change the sun's position");
            widget_label.setPosition(10, 10);

            widget_slider = new WidgetSlider(gui, 0, 360, 60);
            widget_slider.setToolTip("Slide to change sun position");
            widget_slider.setPosition(100, 10);
            //widget_slider.setCallback0(Gui.CHANGED, new Widget.Callback0(this, onSliderChanged));

            widget_button_del = new WidgetButton(gui, "Delete");
            widget_button_del.setToolTip("Delect object(s) selected in combo box");
            widget_button_del.setPosition(170, 50);
            UserInterface.Callback0 c0 = new UserInterface.Callback0(onButtonDelClicked);
            widget_button_del.setCallback0(Gui.CLICKED, );

            widget_button_close = new WidgetButton(gui, "Delete");
            widget_button_close.setToolTip("Delect object(s) selected in combo box");
            widget_button_close.setPosition(170, 50);
            //widget_button_close.setCallback0(Gui.CLICKED, new Widget.Callback0(this, OnButtonDelClicked()));

            widget_button_fopen = new WidgetButton(gui, "Delete");
            widget_button_fopen.setToolTip("Delect object(s) selected in combo box");
            widget_button_fopen.setPosition(170, 50);
            //widget_button_fopen.setCallback0(Gui.CLICKED, new Widget.Callback0(this, OnButtonDelClicked()));

            widget_button_wload = new WidgetButton(gui, "Delete");
            widget_button_wload.setToolTip("Delect object(s) selected in combo box");
            widget_button_wload.setPosition(170, 50);
            //widget_button_wload.setCallback0(Gui.CLICKED, new Widget.Callback0(this, OnButtonDelClicked()));

            return(1);
        }
Esempio n. 3
0
        public LoadingMenu(string title, Job job, GameState gameState) : base(gameState)
        {
            _job = job;

            PauseGame = true;

            _progressLabel = new WidgetLabel
            {
                Anchor     = Anchor.Center,
                Font       = Resources.FontRomulus,
                Origine    = Anchor.Center,
                Text       = "",
                UnitOffset = new Point(0, -16)
            };

            _progressBar = new WidgetProgress
            {
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitBound  = new Rectangle(0, 0, 320 + 64, 8),
                UnitOffset = new Point(0, 16)
            };

            Content = new LayoutDock
            {
                Children =
                {
                    new WidgetLabel
                    {
                        Text       = title,
                        Anchor     = Anchor.Center,
                        Origine    = Anchor.Center,
                        UnitOffset = new Point(0),
                        Font       = Resources.FontAlagard,
                        TextSize   = 1f,
                    },
                    new WidgetFancyPanel
                    {
                        Anchor  = Anchor.Bottom,
                        Origine = Anchor.Bottom,
                        Content = new LayoutDock{
                            Children ={ _progressBar,                    _progressLabel }
                        },
                        Dock       = Rise.Platform.Family == Framework.Platform.PlatformFamily.Mobile ? Dock.Fill : Dock.None,
                        UnitBound  = new Rectangle(0, 0, 512, 96),
                        UnitOffset = new Point(0, -32)
                    }
                }
            };

            _job.Start(true);

            _job.Finish += (sender, e) =>
            {
                if (!_job.Canceled)
                {
                    gameState.CurrentMenu = new MenuInGame(gameState);
                }
            };
        }
Esempio n. 4
0
 public static XElement ToXElement(this WidgetLabel label)
 {
     return(new XElement("WidgetLabel",
                         new XElement("Id", label.Id),
                         new XElement("WidgetId", label.WidgetId),
                         new XElement("Key", label.Key),
                         new XElement("Value", label.Value)
                         ));
 }
        public override void Load()
        {
            var background = Rise.Rnd.Pick(Resources.ParalaxeForest, Resources.ParalaxeMontain);

            Rise.Scene.SetBackground(background);
            Rise.Sound.Play(Resources.Theme0);

            var title = new WidgetLabel
            {
                Text       = Game.Title,
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitOffset = new Point(0),
                Font       = Resources.FontAlagard,
                TextSize   = 6f,
            };

            var subTitle = new WidgetLabel
            {
                Text       = Game.SubTitle,
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitOffset = new Point(0, 72),
                Font       = Resources.FontRomulus,
                TextColor  = ColorPalette.Accent,
                TextSize   = 1f,
            };

            var prompt = new WidgetButton("> Press any key <")
            {
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitOffset = new Point(0, 256),
                Font       = Resources.FontRomulus,
            }.RegisterMouseClickEvent(Game.GoToMainMenu);

            var version = new WidgetLabel
            {
                Text           = $"{Game.Title} {Game.Version}",
                Anchor         = Anchor.BottomRight,
                Origine        = Anchor.BottomRight,
                UnitOffset     = new Point(-16, 0),
                Font           = Resources.FontHack,
                TextAlignement = TextAlignement.Right,
                TextColor      = Color.White * 0.5f,
                TextSize       = 1f,
            };

            Container = new LayoutDock()
            {
                Children =
                {
                    title, subTitle, prompt, version
                }
            };
        }
Esempio n. 6
0
        protected DialogWindow(string title, string text, string yesText, string noText)
            : base(WindowFlags.CustomAnim | WindowFlags.Blackout)
        {
            m_panel = new WidgetWindow(WidgetManager.GetStyle("dialog_window"));
            Vector2 size = m_panel.Size;

            m_text           = new WidgetText();
            m_text.Text      = text;
            m_text.Size      = new Vector2(size.X, 0);
            m_text.MaxWidth  = size.X - 40;
            m_text.FontSize *= 1.25f;
            m_text.TextAlign = WidgetAlign.VerticalCenter | WidgetAlign.HorizontalCenter;
            m_text.Relayout();
            size            = m_panel.Size = m_panel.Size + new Vector2(0, m_text.Size.Y - 80);
            m_text.Position = new Vector2(0, size.Y / 2 - m_text.Size.Y / 2);
            m_panel.AddChild(m_text);

            Size = size;

            if (!string.IsNullOrEmpty(noText))
            {
                m_noButton      = new WidgetButton(noText);
                m_noButton.Size = new Vector2(128, 48);

                m_noButton.Position = new Vector2(size.X * 2 / 3 - (m_noButton.Size.X) / 2, size.Y - m_noButton.Size.Y - 25);
                m_noButton.OnPress += delegate { HandleButtonPress(1); };
                m_panel.AddChild(m_noButton);
            }

            m_yesButton          = new WidgetButton(yesText);
            m_yesButton.Size     = new Vector2(128, 48);
            m_yesButton.Position = new Vector2(m_noButton == null ? size.X / 2 - (m_yesButton.Size.X) / 2 : size.X / 3 - m_yesButton.Size.X * 0.25f, size.Y - m_yesButton.Size.Y - 25);
            m_yesButton.OnPress += delegate { HandleButtonPress(0); };
            m_panel.AddChild(m_yesButton);

            m_closeButton              = new WidgetButton(WidgetManager.GetStyle("image_button"), "");
            m_closeButton.Size         = new Vector2(40, 40);
            m_closeButton.Image        = "close_icon";
            m_closeButton.ImagePadding = new Margin(10, 10, 10, 10);
            m_closeButton.Position     = new Vector2(size.X - m_closeButton.Size.X, 0);
            m_closeButton.OnPress     += delegate { HandleButtonPress(2); };
            m_panel.AddChild(m_closeButton);

            m_title           = new WidgetLabel();
            m_title.Text      = title;
            m_title.Size      = new Vector2(size.X, 50);
            m_title.Position  = new Vector2(0, 20);
            m_title.FontSize *= 1.5f;
            m_title.TextAlign = WidgetAlign.Top | WidgetAlign.HorizontalCenter;
            m_panel.AddChild(m_title);

            AddChild(m_panel);
        }
Esempio n. 7
0
        public override void Load()
        {
            _progressLabel = new WidgetLabel
            {
                Anchor     = Anchor.Center,
                Font       = Resources.FontRomulus,
                Origine    = Anchor.Center,
                Text       = "Loading...",
                UnitOffset = new Point(0, -24)
            };

            _progressBar = new WidgetProgress
            {
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitBound  = new Rectangle(0, 0, 320, 8),
                UnitOffset = new Point(0, 24)
            };

            var _cancelButton = new WidgetSprite()
            {
                Anchor     = Anchor.TopRight,
                Origine    = Anchor.Center,
                Sprite     = new Sprite(Resources.TileGui, new Point(7, 7)),
                UnitBound  = new Rectangle(0, 0, 48, 48),
                UnitOffset = new Point(-48, 48)
            }.RegisterMouseClickEvent((sender) =>
            {
                _job.Cancel();
                Game.GoToMainMenu();
            });

            Container = new LayoutDock
            {
                Padding  = new Spacing(16),
                Children =
                {
                    new WidgetFancyPanel
                    {
                        Anchor  = Anchor.Center,
                        Content = new LayoutDock{
                            Children ={ _progressBar,                    _progressLabel, _cancelButton }
                        },
                        Dock      = Rise.Platform.Family == Framework.Platform.PlatformFamily.Mobile ? Dock.Fill : Dock.None,
                        Origine   = Anchor.Center,
                        UnitBound = new Rectangle(0, 0, 840, 256),
                    }
                }
            };

            _job.Start(true);
        }
Esempio n. 8
0
        public IHtmlString GetWidgetLabel(Widget widget, string key, bool editableInDesignPage)
        {
            var label = widget.Labels.FirstOrDefault(i => i.Key == key);

            if (label == null)
            {
                lock (_staticKey)
                {
                    label = new WidgetLabel
                    {
                        Key   = key,
                        Value = key
                    };
                    widget.Labels.Add(label);
                    SaveChanges();
                }
            }

            return(Wrapper(LabelType.WidgetLabel, label, editableInDesignPage));
        }
        public TabLoadWorld()
        {
            Icon = new Sprite(Resources.TileIcons, new Point(2, 2));

            var title = new WidgetLabel
            {
                Text = "Load World",
                Font = Resources.FontAlagard,
                Dock = Dock.Top
            };

            var saveList = new WidgetList()
            {
                Dock = Dock.Fill
            };

            var loadButton = new WidgetButton
            {
                Text = "Load",
                Dock = Dock.Bottom
            }
            .RegisterMouseClickEvent((sender) =>
            {
                if (saveList.SelectedItem != null)
                {
                    var item = (ListItemWorld)saveList.SelectedItem;
                    Game.Play(item.WorldPath);
                }
            });

            Content = new LayoutDock();
            Content.AddChildren(title, loadButton, saveList);
            Content.Padding = new Spacing(16);

            var s = Directory.GetDirectories(Game.SavesFolder);

            foreach (var save in s)
            {
                saveList.AddItem(new ListItemWorld(Path.GetFileName(save), save));
            }
        }
Esempio n. 10
0
        public MinimapTab(GameState gameState) : base(gameState)
        {
            Icon = new Sprite(Resources.TileIcons, new Point(5, 4));

            var title = new WidgetLabel
            {
                Text = "Maps",
                Font = Resources.FontAlagard,
                Dock = Dock.Top
            };

            var minimap = new WidgetMinimap(gameState)
            {
                Dock = Dock.Fill
            };

            Content = new LayoutDock
            {
                Padding  = new Spacing(16),
                Children = { title, minimap }
            };
        }
Esempio n. 11
0
    private void Init()
    {
        // write here code to be called on component initialization
//		var ui = Gui.Get();

        titleEnd = Game.Time;

        ui = ObjUI.GetGui();


        WidgetLabel lab1 = new WidgetLabel(ui, "Testing and work!");

        lab1.SetToolTip("Works!");
        lab1.Arrange();
        lab1.SetPosition(10, 10);


        ui.AddChild(lab1, Gui.ALIGN_OVERLAP | Gui.ALIGN_FIXED);

        nextTile();

        Unigine.Console.Run("show_messages 1");
    }
Esempio n. 12
0
    private void Update()
    {
        // write here code to be called before updating each render frame

        if (Game.Time > titleEnd)
        {
            Log.Message("Changing Title");
            nextTile();
        }

        float tv = titleEnd - Game.Time;
        float rv = tv / TitleTime;

        rv = 1.0f - rv;

        float ang = 0.0f;

        if (curSprites.Count > 0)
        {
            for (int i = 0; i < 8; i++)
            {
                WidgetLabel s1 = curSprites[i];
//				s1.Color = new vec4(rv*0.3f, rv*0.3f, rv*0.3f, rv*0.3f);


                //ang = ang * Unigine.MathLib.DEG2RAD;


                float mx = Unigine.MathLib.Cos(ang) * 80 * (1.0f - rv);
                float my = Unigine.MathLib.Sin(ang) * 80 * (1.0f - rv);

                s1.SetPosition(200 + (int)mx, 200 + (int)my);

                ang = ang + 45;
            }
        }
    }
Esempio n. 13
0
        public TestWindow()
            : base(WindowFlags.None)
        {
            Size  = new Vector2(2048, 2048.0f * WindowController.Instance.ScreenHeight / WindowController.Instance.ScreenWidth);
            Scale = WindowController.Instance.ScreenHeight / Size.Y;

            WidgetPanel panel = new WidgetWindow();

            panel.Size     = new Vector2(600, 760);
            panel.Scale    = WindowController.Instance.ScreenScale;
            panel.Position = Size / 2 - panel.Size * panel.Scale / 2;
            AddChild(panel);

            WidgetPanel back = new WidgetPanel(WidgetManager.GetStyle("back_pattern"));

            back.Size = panel.Size;
            panel.AddChild(back);

            WidgetLabel title = new WidgetLabel();

            title.Text      = ResourceLoader.Instance.GetString("login_title");
            title.Size      = new Vector2(panel.Size.X, 60);
            title.Position  = new Vector2(0, 50);
            title.FontSize  = WidgetManager.FontScale * 1.5f;
            title.TextAlign = WidgetAlign.Top | WidgetAlign.HorizontalCenter;
            panel.AddChild(title);

            WidgetLabel loginLabel = new WidgetLabel();

            loginLabel.Text     = ResourceLoader.Instance.GetString("login_login");
            loginLabel.Position = new Vector2(50, 160);
            loginLabel.FontSize = WidgetManager.FontScale * 1.25f;
            panel.AddChild(loginLabel);

            m_loginEdit                = new WidgetTextEdit();
            m_loginEdit.Text           = DefaultLogin;
            m_loginEdit.Size           = new Vector2(500, 45);
            m_loginEdit.Position       = new Vector2(50, 200);
            m_loginEdit.FontSize       = WidgetManager.FontScale * 1.25f;
            m_loginEdit.OnTextEntered += HandleLoginEntered;
            panel.AddChild(m_loginEdit);
            m_loginEdit.SetFocused(true);

            WidgetLabel passLabel = new WidgetLabel();

            passLabel.Text     = ResourceLoader.Instance.GetString("login_password");
            passLabel.Position = new Vector2(50, 260);
            passLabel.FontSize = WidgetManager.FontScale * 1.25f;
            panel.AddChild(passLabel);

            m_passEdit                = new WidgetTextEdit();
            m_passEdit.Text           = DefaultPassword;
            m_passEdit.Size           = new Vector2(500, 45);
            m_passEdit.Position       = new Vector2(50, 300);
            m_passEdit.FontSize       = WidgetManager.FontScale * 1.25f;
            m_passEdit.MaskChar       = "*";
            m_passEdit.OnTextEntered += HandlePassEntered;
            panel.AddChild(m_passEdit);
            m_passEdit.SetFocused(false);

            WidgetLabel localLabel = new WidgetLabel();

            localLabel.Text     = ResourceLoader.Instance.GetString("login_local");
            localLabel.Position = new Vector2(90, 360);
            localLabel.Color    = 0xcceeff;
            localLabel.FontSize = WidgetManager.FontScale * 1.0f;
            panel.AddChild(localLabel);

            m_localCheckBox            = new WidgetCheckBox(true);
            m_localCheckBox.Position   = new Vector2(50, 360);
            m_localCheckBox.Checked    = false;
            localLabel.Visible         = true;
            m_localCheckBox.OnChecked += delegate(WidgetCheckBox cb)
            {
                m_localEdit.Visible = cb.Checked;
            };

            panel.AddChild(m_localCheckBox);

            m_localCheckBox.LinkedLabel = localLabel;

            m_localEdit                  = new WidgetTextEdit();
            m_localEdit.Text             = "127.0.0.1";
            m_localEdit.Size             = new Vector2(500, 45);
            m_localEdit.Position         = new Vector2(50, 100);
            m_localEdit.FontSize         = WidgetManager.FontScale * 1.25f;
            m_localEdit.Visible          = m_localCheckBox.Checked && m_localCheckBox.Visible;
            m_localEdit.OnTextEntered   += delegate { HandleLoginPress(null); };
            m_localEdit.OnValidateInput += HandleValidateIpInput;
            panel.AddChild(m_localEdit);
            m_localEdit.SetFocused(false);


            WidgetButton webSiteButton = new WidgetButton(WidgetManager.GetStyle("text_button"), ResourceLoader.Instance.GetString("login_register"));

            webSiteButton.Position = new Vector2(50, 360 + (m_localCheckBox.Visible ? 40 : 0));
            webSiteButton.FontSize = WidgetManager.FontScale * 1.0f;
            webSiteButton.OnPress += delegate { HandleWebSitePress(null); };
            panel.AddChild(webSiteButton);

            m_loginButton          = new WidgetButton(ResourceLoader.Instance.GetString("login_connect"));
            m_loginButton.Size     = new Vector2(160, 48);
            m_loginButton.FontSize = WidgetManager.FontScale * 1.25f;
            m_loginButton.Position = new Vector2(panel.Size.X / 2 - m_loginButton.Size.X / 2, 460);
            m_loginButton.Enabled  = false;
            m_loginButton.OnPress += delegate { HandleLoginPress(null); };
            m_loginButton.Tooltip  = "@tooltip_connect";
            panel.AddChild(m_loginButton);

            WidgetImage logoImage = new WidgetImage(WidgetBackgroundStyle.ImageFit, "settings_icon");

            logoImage.Size     = new Vector2(64, 64);
            logoImage.Position = new Vector2(20, 15);
            panel.AddChild(logoImage);


            WidgetTextField textTextField = new WidgetTextField(WidgetManager.GetStyle("default_textedit"));

            textTextField.Size     = new Vector2(500, 225);
            textTextField.Position = new Vector2(50, 520);
            textTextField.FontSize = WidgetManager.FontScale * 1.25f;
            textTextField.Visible  = true;
            textTextField.Text     = "WidgetTextField textTextField = new WidgetTextField(WidgetManager.GetStyle(\"default_textedit\"));\n            textTextField.Size = new Vector2(500, 225);\n            textTextField.Position = new Vector2(50, 520);\n            textTextField.FontSize = WidgetManager.FontScale * 1.25f;\n            textTextField.Visible = true";
            panel.AddChild(textTextField);

            m_fpsLabel          = new WidgetLabel();
            m_fpsLabel.Text     = "1";
            m_fpsLabel.Position = new Vector2(440, 20);
            m_fpsLabel.FontSize = WidgetManager.FontScale * 0.75f;
            panel.AddChild(m_fpsLabel);
        }
Esempio n. 14
0
        public override void Load()
        {
            Rise.Sound.Play(Resources.Theme0);

            var title = new WidgetLabel
            {
                Text       = Game.Title,
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitOffset = new Point(0, -72),
                Font       = Resources.FontAlagard,
                TextSize   = 3f,
            };

            var subTitle = new WidgetLabel
            {
                Text       = Game.SubTitle,
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitOffset = new Point(0, -16),
                Font       = Resources.FontRomulus,
                TextColor  = ColorPalette.Accent,
                TextSize   = 1f,
            };

            var copyright = new WidgetLabel
            {
                Text     = "© 2017-2021 SMNX",
                Anchor   = Anchor.Bottom,
                Origine  = Anchor.Bottom,
                Font     = Resources.FontRomulus,
                TextSize = 1f
            };

            var continueButton = new WidgetButton
            {
                Enabled    = Game.GetLastGame() != null,
                Text       = "Continue",
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitOffset = new Point(0, 72),
                UnitBound  = new Rectangle(0, 0, 256, 64),
            }
            .RegisterMouseClickEvent((sender) => Game.Play(Game.GetLastGame()));

            var version = new WidgetLabel
            {
                Text           = $"{Game.Title} {Game.Version}",
                Anchor         = Anchor.BottomRight,
                Origine        = Anchor.BottomRight,
                UnitOffset     = new Point(-16, 0),
                Font           = Resources.FontHack,
                TextAlignement = TextAlignement.Right,
                TextColor      = Color.White * 0.5f,
                TextSize       = 1f,
            };

            var homeTab = new Tab
            {
                Icon    = new Sprite(Resources.TileIcons, new Point(0, 4)),
                Content = new LayoutDock()
                {
                    Children =
                    {
                        title, subTitle, copyright, continueButton
                    }
                }
            };

            var menu = new WidgetTabContainer
            {
                Anchor     = Anchor.Center,
                Origine    = Anchor.Center,
                UnitBound  = new Rectangle(0, 0, 600, 720),
                TabAnchore = Rise.Platform.Family == PlatformFamily.Mobile ? TabAnchore.Bottom : TabAnchore.Left,
                Tabs       =
                {
                    homeTab,
                    new TabNewWorld(),
                    new TabLoadWorld(),
                    new TabOption(),
                }
            };

            Container = new LayoutDock().AddChildren(menu, version);
        }
Esempio n. 15
0
        public TestWindow()
            : base(WindowFlags.None)
        {
            Size  = new Vector2(2048, 2048.0f * WindowController.Instance.ScreenHeight / WindowController.Instance.ScreenWidth);
            Scale = WindowController.Instance.ScreenHeight / Size.Y;

            WidgetPanel panel = new WidgetPanel(WidgetManager.DefaultWindowStyle);

            panel.Size     = new Vector2(600, 560);
            panel.Scale    = WindowController.Instance.ScreenScale;
            panel.Position = Size / 2 - panel.Size * panel.Scale / 2;
            AddChild(panel);

            WidgetPanel back = new WidgetPanel(WidgetManager.GetStyle("back_pattern"));

            back.Size = panel.Size;
            panel.AddChild(back);

            WidgetLabel title = new WidgetLabel();

            title.Text      = ResourceLoader.Instance.GetString("login_title");
            title.Size      = new Vector2(panel.Size.X, 60);
            title.Position  = new Vector2(0, 50);
            title.FontSize  = WidgetManager.DefaultLabelStyle.FontSize * 1.5f;
            title.TextAlign = WidgetAlign.Top | WidgetAlign.HorizontalCenter;
            panel.AddChild(title);

            WidgetLabel loginLabel = new WidgetLabel();

            loginLabel.Text     = ResourceLoader.Instance.GetString("login_login");
            loginLabel.Position = new Vector2(50, 160);
            loginLabel.FontSize = WidgetManager.DefaultLabelStyle.FontSize * 1.25f;
            panel.AddChild(loginLabel);

            m_loginEdit                = new WidgetTextEdit();
            m_loginEdit.Text           = DefaultLogin;
            m_loginEdit.Size           = new Vector2(500, 45);
            m_loginEdit.Position       = new Vector2(50, 200);
            m_loginEdit.FontSize       = WidgetManager.DefaultLabelStyle.FontSize * 1.25f;
            m_loginEdit.OnTextEntered += HandleLoginEntered;
            panel.AddChild(m_loginEdit);
            m_loginEdit.SetFocused(true);

            WidgetLabel passLabel = new WidgetLabel();

            passLabel.Text     = ResourceLoader.Instance.GetString("login_password");
            passLabel.Position = new Vector2(50, 260);
            passLabel.FontSize = WidgetManager.DefaultLabelStyle.FontSize * 1.25f;
            panel.AddChild(passLabel);

            m_passEdit                = new WidgetTextEdit();
            m_passEdit.Text           = DefaultPassword;
            m_passEdit.Size           = new Vector2(500, 45);
            m_passEdit.Position       = new Vector2(50, 300);
            m_passEdit.FontSize       = WidgetManager.DefaultLabelStyle.FontSize * 1.25f;
            m_passEdit.MaskChar       = '*';
            m_passEdit.OnTextEntered += HandlePassEntered;
            panel.AddChild(m_passEdit);
            m_passEdit.SetFocused(false);

            WidgetLabel localLabel = new WidgetLabel();

            localLabel.Text     = ResourceLoader.Instance.GetString("login_local");
            localLabel.Position = new Vector2(90, 360);
            localLabel.Color    = 0xcceeff;
            localLabel.FontSize = WidgetManager.DefaultLabelStyle.FontSize * 1.0f;
            panel.AddChild(localLabel);

            m_localCheckBox = new WidgetCheckBox();
            //m_localCheckBox.Size = new Vector2(30, 30);
            m_localCheckBox.Position   = new Vector2(50, 360);
            m_localCheckBox.Checked    = false;
            localLabel.Visible         = true;
            m_localCheckBox.OnChecked += delegate(WidgetCheckBox cb)
            {
                m_localEdit.Visible = cb.Checked;
            };

            panel.AddChild(m_localCheckBox);

            m_localCheckBox.LinkedLabel = localLabel;

            m_localEdit                = new WidgetTextEdit();
            m_localEdit.Text           = "127.0.0.1";
            m_localEdit.Size           = new Vector2(500, 45);
            m_localEdit.Position       = new Vector2(50, 100);
            m_localEdit.FontSize       = WidgetManager.DefaultLabelStyle.FontSize * 1.25f;
            m_localEdit.Visible        = m_localCheckBox.Checked && m_localCheckBox.Visible;
            m_localEdit.OnTextEntered += delegate { HandleLoginPress(null); };
            panel.AddChild(m_localEdit);
            m_localEdit.SetFocused(false);


            WidgetButton webSiteButton = new WidgetButton(WidgetManager.GetStyle("text_button"), ResourceLoader.Instance.GetString("login_register"));

            webSiteButton.Position = new Vector2(50, 360 + (m_localCheckBox.Visible ? 40 : 0));
            webSiteButton.FontSize = WidgetManager.DefaultLabelStyle.FontSize * 1.0f;
            webSiteButton.OnPress += delegate { HandleWebSitePress(null); };
            panel.AddChild(webSiteButton);

            m_loginButton          = new WidgetButton(ResourceLoader.Instance.GetString("login_connect"));
            m_loginButton.Size     = new Vector2(160, 48);
            m_loginButton.FontSize = WidgetManager.DefaultLabelStyle.FontSize * 1.25f;
            m_loginButton.Position = new Vector2(panel.Size.X / 2 - m_loginButton.Size.X / 2, 460);
            m_loginButton.OnPress += delegate { HandleLoginPress(null); };
            panel.AddChild(m_loginButton);
        }