Esempio n. 1
0
        private void InitialiseExitButton(ContentManager contentManager, Rectangle screenBounds)
        {
            var buttonSprite = new Sprite
            {
                Texture = contentManager.Load<Texture2D>("button")
            };

            buttonSprite.CenterHorizontal(new Rectangle(-200, 200, screenBounds.Width, 0));

            var buttonText = new Text
            {
                Message = "Press to Exit",
                Color = Color.Black,
                SpriteFont = contentManager.Load<SpriteFont>("Title")
            };

            buttonText.Center(buttonSprite.Bounds);

            IGuiEl buttonleave = new Button
            {
                //Sprite = buttonSprite,
                //DefaultSpriteColor = Color.White,
                //HoverSpriteColor = Color.Black,
                //Text = buttonText,
                //DefaultTextColor = Color.Black,
                //HoverTextColor = Color.White
            };

            m_buttons.Add(buttonleave);
        }
 public void m_onHovered(Button onHovered)
 {
     Console.WriteLine("Ik heb op button gehovered");
 }
Esempio n. 3
0
        private void InitialiseContinueButton(ContentManager contentManager, Rectangle screenBounds)
        {
            var buttonSprite = new Sprite
            {
                Texture = contentManager.Load<Texture2D>("button2")
            };

            buttonSprite.CenterHorizontal(new Rectangle(200, 200, screenBounds.Width, 0));

            var buttonText = new Text
            {
                Message = "Press to Stay",
                Color = Color.Black,
                SpriteFont = contentManager.Load<SpriteFont>("Title")
            };

            buttonText.Center(buttonSprite.Bounds);

            IGuiEl buttonstay = new Button
            {
                Sprite = buttonSprite,
                DefaultSpriteColor = Color.White,
                HoverSpriteColor = Color.Black,
                Text = buttonText,
                DefaultTextColor = Color.Black,
                HoverTextColor = Color.White
            };
            buttonstay.OnClicked += ChangeBetweenScreens;

            m_buttons.Add(buttonstay);
        }
 public void m_onClicked(Button OnClicked)
 {
     Console.WriteLine("Ik heb op button geklikt");
 }