Exemplo n.º 1
0
        public UICheckbox(string text, int x, int top, int screenHeight, XMode xmode = XMode.Left)
        {
            m_bEnabled          = true;
            m_XMode             = xmode;
            m_szText            = text;
            m_TextColor         = Color.LightGray;
            m_TextDisabledColor = Color.Gray;

            m_iCheckboxSize = (int)(Constants.MessageBox_CheckboxSize * screenHeight);

            Layout(x, top);
        }
Exemplo n.º 2
0
        public UILabel(string text, int x, int y, Color color, SpriteFont font, XMode mode)
        {
            m_bHidden = false;

            m_szText = text;
            m_Color  = color;
            m_Font   = font;

            m_XMode     = mode;
            m_X         = x;
            m_vPosition = new Vector2(x, y);
            DoLayout();
        }
Exemplo n.º 3
0
        public UILabel(string text, int x, int y, Color color, SpriteFont font, XMode mode)
        {
            m_bHidden = false;

            m_szText = text;
            m_Color = color;
            m_Font = font;

            if (mode == XMode.Left)
                m_vPosition = new Vector2(x, y);
            else if (mode == XMode.Center)
            {
                Vector2 size = font.MeasureString(text);
                m_vPosition.X = x - (size.X * 0.5f);
                m_vPosition.Y = y;
            }
            else
            {
                Vector2 size = font.MeasureString(text);
                m_vPosition.X = x - size.X;
                m_vPosition.Y = y;
            }
        }
Exemplo n.º 4
0
 public static bool HasMode(int mode, XMode modeToCheck)
 {
     return((mode & (int)modeToCheck) != 0);
 }