Beispiel #1
0
        protected override void InternalDraw(YSpriteBatch spritebatch, double frameTime)
        {
            Color color = Model.IsEnabled ? Color.White : new Color(160, 160, 160, 255);

            Rendering.ARenderer renderer = Model.IsMouseOver ? (Model.IsMouseDown ? m_Down : m_Hover) : m_Normal;
            renderer.Render(spritebatch, Model.ScreenArea, color);
            if (Model.DrawIcon)
            {
                Rectangle icon_area = Model.ScreenArea;
                icon_area.X += 4;
                icon_area.Y += 4;
                icon_area.Width = 36;
                icon_area.Height -= 8;
                m_Icon.Render(spritebatch, icon_area);
            }
            if (Model.Caption != null && Model.Caption != string.Empty)
            {
                if (m_WrappedText == null)
                    m_WrappedText = new WrappedText();
                Rectangle area = Model.ScreenArea;
                area.X += (Model.DrawIcon ? 44 : 4);
                // area.Y += 4;
                area.Width -= (Model.DrawIcon ? 48 : 8);
                // area.Height -= 8;

                m_WrappedText.Draw(spritebatch, Font, area, Model.Caption, Model.FontSize, FontJustification.Center | FontJustification.CenterVertically, color);
            }
        }
Beispiel #2
0
        protected override void InternalDraw(YSpriteBatch spritebatch, double frameTime)
        {
            Color color = Model.IsEnabled ? Color.White : new Color(160, 160, 160, 255);

            Rendering.ARenderer renderer = Model.IsChecked ? m_Checked : m_Normal;
            renderer.Render(spritebatch, Model.ScreenArea, color);

            if (Model.Caption != null && Model.Caption != string.Empty)
            {
                if (m_WrappedText == null)
                    m_WrappedText = new WrappedText();
                Rectangle area = Model.ScreenArea;
                area.X += 16;
                area.Width -= 16;

                m_WrappedText.Draw(spritebatch, Font, area, Model.Caption, Model.FontSize, FontJustification.Left | FontJustification.Bottom, color);
            }
        }
Beispiel #3
0
 protected override void InternalDraw(YSpriteBatch spritebatch, double frameTime)
 {
     if (m_WrappedText == null)
         m_WrappedText = new WrappedText();
     m_WrappedText.Draw(spritebatch, Font, Model.ScreenArea, Model.Caption, Model.FontSize, Model.Justification, Model.Color);
 }