Пример #1
0
        private void Init(IColorPreset colorPreset)
        {
            loginButton = CreateChild <BoxButton>("login", 4);
            {
                loginButton.Anchor = AnchorType.TopStretch;
                loginButton.Pivot  = PivotType.Top;
                loginButton.SetOffsetHorizontal(48f);
                loginButton.Y         = -16;
                loginButton.Height    = 36f;
                loginButton.Color     = colorPreset.Positive;
                loginButton.LabelText = "OAuth log in";

                loginButton.OnTriggered += DoLogin;
            }
        }
Пример #2
0
        private void Init(IColorPreset colorPreset)
        {
            username = CreateChild <LoginInput>("username", 1);
            {
                username.Anchor = AnchorType.TopStretch;
                username.Pivot  = PivotType.Top;
                username.SetOffsetHorizontal(32);
                username.Y           = -16f;
                username.Height      = 36f;
                username.Placeholder = "username";
            }
            password = CreateChild <LoginInput>("password", 2);
            {
                password.Anchor = AnchorType.TopStretch;
                password.Pivot  = PivotType.Top;
                password.SetOffsetHorizontal(32f);
                password.Y           = -60f;
                password.Height      = 36f;
                password.InputType   = InputField.InputType.Password;
                password.Placeholder = "password";
            }
            remember = CreateChild <LabelledToggle>("remember", 3);
            {
                remember.Anchor    = AnchorType.Top;
                remember.Pivot     = PivotType.Top;
                remember.Position  = new Vector3(0f, -104f);
                remember.Size      = new Vector2(170f, 24f);
                remember.LabelText = "Remember me";
            }
            loginButton = CreateChild <BoxButton>("login", 4);
            {
                loginButton.Anchor = AnchorType.TopStretch;
                loginButton.Pivot  = PivotType.Top;
                loginButton.SetOffsetHorizontal(48f);
                loginButton.Y         = -148f;
                loginButton.Height    = 36f;
                loginButton.Color     = colorPreset.Positive;
                loginButton.LabelText = "Log in";

                loginButton.OnTriggered += DoLogin;
            }

            OnEnableInited();
        }