Пример #1
0
        /// <summary>
        /// Draws the label
        /// </summary>
        public override void Draw(Otter.Interface.Graphics graphics)
        {
            if (mText == "" || mText == null)
            {
                return;
            }

            if (mFont == null)
            {
                return;
            }

            LabelLayout layout = Layout as LabelLayout;

            mFont.Draw(mText, 0, 0, layout.Size.Width, layout.Size.Height, layout.Color, layout.Scale, HorizontalAlignment, VerticalAlignment, mLeading, mTracking, Skew, mTextFit, DropShadow, InheritedMask);
        }
Пример #2
0
        /// <summary>
        /// Draws the button
        /// </summary>
        public override void Draw(Otter.Interface.Graphics graphics)
        {
            TextureInfo info  = Scene.GetTextureInfo(mCurrentState == ButtonState.Default ? mDefaultTextureID : mDownTextureID);
            Color       color = mCurrentState == ButtonState.Default ? mDefaultColor : mDownColor;
            int         texID = (info != null) ? info.TextureID : -1;

            graphics.DrawRectangle(texID, 0.0f, 0.0f, this.Size.Width, this.Size.Height, color.ToArgb());

            if (mLabel.Text != "")
            {
                GUIFont font = GUIProject.CurrentProject.GetFont(mLabel.FontID);
                if (font != null)
                {
                    ButtonLayout layout = Layout as ButtonLayout;
                    font.Draw(mLabel.Text, 0, 0, layout.Size.Width, layout.Size.Height, layout.TextColor, layout.TextScale, HorizontalAlignment, VerticalAlignment);
                }
            }
        }