예제 #1
0
        /// <summary>
        /// Equals override
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            ButtonLayout layout = (ButtonLayout)obj;

            return(base.Equals(obj) &&
                   layout.TextColor.Equals(this.TextColor) &&
                   layout.TextScale == this.TextScale);
        }
예제 #2
0
        /// <summary>
        /// Clone override
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            ButtonLayout clone = new ButtonLayout();

            clone.SetFrom(this);

            clone.TextColor = this.TextColor;
            clone.TextScale = this.TextScale;

            return clone;
        }
예제 #3
0
        /// <summary>
        /// Clone override
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            ButtonLayout clone = new ButtonLayout();

            clone.SetFrom(this);

            clone.TextColor = this.TextColor;
            clone.TextScale = this.TextScale;

            return(clone);
        }
예제 #4
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);
                }
            }
        }
예제 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GUIButton()
 {
     Name = "Button";
     Layout = new ButtonLayout();
 }
예제 #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GUIButton()
 {
     Name   = "Button";
     Layout = new ButtonLayout();
 }