Ejemplo n.º 1
0
        /// <summary>
        /// Creates skin styles
        /// </summary>
        /// <param name="contentManager">Content manager</param>
        public GameSkin(NezContentManager contentManager)
        {
            Skin = new Skin();

            Skin.Add("title-label", new LabelStyle()
            {
                Font = contentManager.LoadBitmapFont(Content.OswaldTitleFont)
            });

            Skin.Add("label", new LabelStyle()
            {
                Font = contentManager.LoadBitmapFont(Content.DefaultTitleFont)
            });

            var inputCursor = new PrimitiveDrawable(Color.Black);

            inputCursor.MinHeight = 10;
            inputCursor.MinWidth  = 5;
            var font = contentManager.LoadBitmapFont(Content.DefaultTitleFont);

            font.FontSize = 24;
            var style = Skin.Add("inputfield", new TextFieldStyle()
            {
                Font              = font,
                FontColor         = Color.Black,
                Cursor            = inputCursor,
                FocusedBackground = new PrimitiveDrawable(Color.Gray),
                Background        = new PrimitiveDrawable(Color.White),
                Selection         = new PrimitiveDrawable(Color.Blue)
            });

            Skin.Add("regular-button", TextButtonStyle.Create(Color.Gray, new Color(61, 9, 85), new Color(61, 9, 107)));


            var sliderStyle = SliderStyle.Create(Color.Yellow, new Color(61, 9, 107));

            sliderStyle.Knob.MinWidth       *= 1.5f;
            sliderStyle.Knob.MinHeight      *= 1.5f;
            sliderStyle.Background.MinWidth *= 0.5f;

            Skin.Add("slider", sliderStyle);
        }
Ejemplo n.º 2
0
        public LobbyScene()
        {
            _gameSettings = GameSettings.Default;

            addRenderer(new ScreenSpaceRenderer(100, Constants.Layers.HUD));
            addRenderer(new RenderLayerExcludeRenderer(0, Constants.Layers.HUD));

            // create our canvas and put it on the screen space render layer
            canvas = createEntity("ui").addComponent(new UICanvas());
            canvas.isFullScreen = true;
            canvas.renderLayer  = Constants.Layers.HUD;

            clearColor = Color.Black;

            normalButtonColor   = new PrimitiveDrawable(Color.Gray);
            pressedButtonColor  = new PrimitiveDrawable(Color.Red);
            hoverButtonColor    = new PrimitiveDrawable(Color.LightGray);
            disabledButtonColor = new PrimitiveDrawable(Color.Pink);

            normalButtonStyle   = new TextButtonStyle(normalButtonColor, pressedButtonColor, hoverButtonColor);
            disabledButtonStyle = new TextButtonStyle(disabledButtonColor, disabledButtonColor, disabledButtonColor);

            SetupSceneSelector();
        }