/// <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); }
/// <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; }
/// <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); }
/// <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); } } }
/// <summary> /// Constructor /// </summary> public GUIButton() { Name = "Button"; Layout = new ButtonLayout(); }