Beispiel #1
0
 public TextButton(Vector2 a_position, string a_text, string a_font)
     : base(a_position)
 {
     m_normalColor = new Color(187, 194, 195);
     m_hoverColor = new Color(255, 255, 255);
     m_pressedColor = new Color(132, 137, 138);
     m_toggleColor = new Color(0, 0, 255);
     m_text = new Text(a_position, a_text, a_font, m_normalColor, false);
     m_isVisible = true;
     m_bounds = m_text.getBox();
     setPosition(a_position);
 }
Beispiel #2
0
 public TextButton(Vector2 a_position, string a_text, string a_font, Color a_normal, Color a_hover, Color a_pressed, Color a_toggle)
     : base(a_position)
 {
     m_text = new Text(a_position, a_text, a_font, a_normal, false);
     m_normalColor = a_normal;
     m_hoverColor = a_hover;
     m_pressedColor = a_pressed;
     m_toggleColor = a_toggle;
     m_isVisible = true;
     m_bounds = m_text.getBox();
     setPosition(a_position);
 }
Beispiel #3
0
        private void testGraphics(Button a_button)
        {
            applyGraphics();

            if (m_countDown == null)
            {
                createDialog("Apply Settings?");
                m_countDown = new Text(Game.getInstance().getResolution() / 2, "", "MotorwerkLarge", m_normal, false);
                m_countDown.move(new Vector2(-(m_countDown.getBox().Width / 2) - 30, -75));
                m_timeOut = Game.getInstance().getTotalGameTime() + new TimeSpan(0, 0, 10);
            }

            createButtons();
        }
Beispiel #4
0
        private void createDialog(string a_text)
        {
            Vector2 t_halfRes = Game.getInstance().getResolution() / 2;

            m_inputFeedback = new Text(t_halfRes, a_text, "VerdanaBold", m_normal, false);
            m_inputFeedback.move(new Vector2(-(m_inputFeedback.getBox().Width / 2), -100));
            m_buttons.AddLast(m_btnYes = new TextButton(new Vector2(t_halfRes.X - 175, t_halfRes.Y), "YES", "MotorwerkLarge", m_normal, m_hover, m_pressed, Color.Red));
            m_buttons.AddLast(m_btnNo = new TextButton(new Vector2(t_halfRes.X + 65, t_halfRes.Y), "NO", "MotorwerkLarge", m_normal, m_hover, m_pressed, Color.Red));
            m_btnYes.m_clickEvent += new TextButton.clickDelegate(buttonYes);
            m_btnNo.m_clickEvent += new TextButton.clickDelegate(buttonNo);
            m_dialogBackground = new Box(new Vector2(t_halfRes.X - 200, t_halfRes.Y - 125), 400, 220, Color.Gray, true);
        }