Esempio n. 1
0
        public override void Initialize()
        {
            BruhUi();

            Chat = new Label("inget mottaget").SetFontScale(3);

            Table.Add(Chat);

            Table.Row().SetPadTop(20);

            textFields = TextFieldStyle.Create(Color.White, Color.White, Color.Black, Color.DarkGray);

            textField = new TextField("", textFields);

            Table.Add(textField);

            Table.Row().SetPadTop(20);

            KörPå            = Table.Add(new TextButton("skicka", Skin.CreateDefaultSkin())).SetFillX().SetMinHeight(30).GetElement <TextButton>();
            KörPå.OnClicked += SickaMeddelade;

            Table.Row().SetPadRight(50);

            /*TextButton Kör = Table.Add(new TextButton("byebye borski" , Skin.CreateDefaultSkin())).SetFillX().SetMinHeight(30).GetElement<TextButton>();
             * Kör.OnClicked += Koppplafrån;*/
            Skin     skin     = Skin.CreateDefaultSkin();
            CheckBox checkbox = Table.Add(new CheckBox("Ready", skin)).GetElement <CheckBox>();

            checkbox.IsChecked  = false;
            checkbox.OnChanged += isChecked => { ReadyStart = isChecked; };
        }
Esempio n. 2
0
        public override void Initialize()
        {
            BruhUi();
            KlientHanterare = new KlientHanterare();
            Core.RegisterGlobalManager(KlientHanterare);
            Table.Add(new Label("ip pls").SetFontScale(5));

            Table.Row().SetPadTop(20);

            TextFieldStyle textFields = TextFieldStyle.Create(Color.White, Color.White, Color.Black, Color.DarkGray);

            textField = new TextField("", textFields);

            Table.Add(textField);

            Table.Row().SetPadTop(20);

            TextButton KörPå = Table.Add(new TextButton("Klicka", Skin.CreateDefaultSkin())).SetFillX().SetMinHeight(30).GetElement <TextButton>();


            KörPå.OnClicked += TextFält;
        }
Esempio n. 3
0
        public override void Initialize()
        {
            base.Initialize();

            //Load Assets, always load textures before generating items so they can match texture and ID
            TextureContainer.LoadTextures();
            AbilityContainerClient.LoadAbilities();
            KeyBindContainer.SetKeyBinds();

            Entity e = CreateEntity("Wallpaper");

            e.AddComponent(new SpriteRenderer(TextureContainer.LoginWallpaper)).SetOrigin(new Vector2(0, 0));
            float h = (float)Screen.Height / (float)TextureContainer.LoginWallpaper.Height;
            float w = (float)Screen.Width / (float)TextureContainer.LoginWallpaper.Width;

            e.SetScale(new Vector2(w, h));
            Sprite textfieldTexture = TextureContainer.GetSpriteAtlasByName("UI").GetSprite("Plank_03");

            TextFieldStyle    textFields = TextFieldStyle.Create(Color.White, Color.White, Color.Black, Color.DarkGray);
            NinePatchDrawable drawable   = new NinePatchDrawable(textfieldTexture, 0, 0, 0, 0)
            {
                MinHeight = 20, MinWidth = 50
            };
            NinePatchDrawable drawablebutton = new NinePatchDrawable(TextureContainer.GetSpriteAtlasByName("UI").GetSprite("plank_15"), 0, 0, 0, 0)
            {
                MinHeight = 20, MinWidth = 50
            };
            NinePatchDrawable drawablehover = new NinePatchDrawable(TextureContainer.GetSpriteAtlasByName("UI").GetSprite("plank_18"), 0, 0, 0, 0)
            {
                MinHeight = 20, MinWidth = 50
            };

            textFields.Background = drawable;

            Label label = new Label("Menu").SetFontScale(5).SetFontColor(Color.MediumVioletRed);

            Table.Add(label);

            Label user = new Label("Username").SetFontScale(2).SetFontColor(Color.MediumVioletRed);

            Table.Row().SetPadTop(10);
            Table.Add(user).Pad(20);
            textFieldu = new TextField("", textFields);

            Table.Row().SetPadTop(10);
            Table.Add(textFieldu);

            Label pass = new Label("Password").SetFontScale(2).SetFontColor(Color.MediumVioletRed);

            Table.Row().SetPadTop(10);
            Table.Add(pass);
            textFieldp = new TextField("", textFields);
            Table.Row().SetPadTop(10);
            textFieldp.SetPasswordMode(true);
            Table.Add(textFieldp);

            TextButtonStyle textButtonStyle = new TextButtonStyle(drawablebutton, drawablehover, drawablehover);

            TextButton button = new TextButton("Login", textButtonStyle);

            button.Pad(10);
            button.PadLeft(20);
            button.PadRight(20);
            button.OnClicked += SendLogin;
            Table.Row().SetPadTop(10);
            Table.Add(button);

            TextButton buttonr = new TextButton("Register", textButtonStyle);

            buttonr.Pad(10);
            buttonr.PadLeft(20);
            buttonr.PadRight(20);
            buttonr.OnClicked += Sendregister;
            Table.Row().SetPadTop(10);
            Table.Add(buttonr);

            //var imGuiManager = new ImGuiManager();
            //Core.RegisterGlobalManager(imGuiManager);
            //imGuiManager.SetEnabled(false);
            //imGuiManager.ShowDemoWindow = true;
        }