3 using Microsoft.Xna.Framework;
4 using Microsoft.Xna.Framework.Graphics;
35 if (value ==
enabled) {
return; }
40 public override Color Color
42 get {
return base.Color; }
52 get {
return base.HoverColor; }
55 base.HoverColor = value;
64 return base.SelectedColor;
68 base.SelectedColor = value;
77 return base.PressedColor;
81 base.PressedColor = value;
88 get {
return base.OutlineColor; }
91 base.OutlineColor = value;
157 base.ToolTip = value;
163 private float pulseTimer;
164 private float pulseExpand;
165 private bool flashed;
179 if (style !=
null) { GUIStyle.Apply(
frame, style ==
"" ?
"GUIButton" : style); }
185 var selfStyle =
Style;
188 TextColor = selfStyle?.TextColor ?? Color.Black,
193 if (rectT.
Rect.Height == 0 && !text.IsNullOrEmpty())
206 base.ApplyStyle(style);
211 public override void Flash(Color?
color =
null,
float flashDuration = 1.5f,
bool useRectangleFlash =
false,
bool useCircularFlash =
false, Vector2? flashRectInflate =
null)
216 protected override void Draw(SpriteBatch spriteBatch)
218 if (
Pulse && pulseTimer > 1.0f)
221 float expand = (pulseExpand * 20.0f) * GUI.Scale;
222 expandRect.Inflate(expand, expand);
224 GUIStyle.EndRoundButtonPulse.Draw(spriteBatch, expandRect, ToolBox.GradientLerp(pulseExpand, Color.White, Color.White, Color.Transparent));
228 protected override void Update(
float deltaTime)
231 base.Update(deltaTime);
293 pulseTimer += deltaTime;
294 if (pulseTimer > 1.0f)
302 pulseExpand += deltaTime;
303 if (pulseExpand > 1.0f)
virtual ComponentState State
virtual void Flash(Color? color=null, float flashDuration=1.5f, bool useRectangleFlash=false, bool useCircularFlash=false, Vector2? flashRectInflate=null)
virtual Color OutlineColor
virtual void ApplyStyle(GUIComponentStyle style)
virtual RichString ToolTip
virtual Color SelectedColor
RectTransform RectTransform
IEnumerable< GUIComponent > Children
virtual Color PressedColor
Vector2 MeasureString(LocalizedString str, bool removeExtraSpacing=false)
ForceUpperCase ForceUpperCase