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;
164 private bool requireHold;
175 Color = GUIStyle.Yellow * 0.33f,
181 else if (holdOverlay !=
null)
188 private float holdTimer;
191 private float pulseTimer;
192 private float pulseExpand;
193 private bool flashed;
207 if (style !=
null) { GUIStyle.Apply(
frame, style ==
"" ?
"GUIButton" : style); }
213 var selfStyle =
Style;
216 TextColor = selfStyle?.TextColor ?? Color.Black,
221 if (rectT.
Rect.Height == 0 && !text.IsNullOrEmpty())
234 base.ApplyStyle(style);
239 public override void Flash(Color?
color =
null,
float flashDuration = 1.5f,
bool useRectangleFlash =
false,
bool useCircularFlash =
false, Vector2? flashRectInflate =
null)
244 protected override void Draw(SpriteBatch spriteBatch)
246 if (
Pulse && pulseTimer > 1.0f)
249 float expand = (pulseExpand * 20.0f) * GUI.Scale;
250 expandRect.Inflate(expand, expand);
252 GUIStyle.EndRoundButtonPulse.Draw(spriteBatch, expandRect, ToolBox.GradientLerp(pulseExpand, Color.White, Color.White, Color.Transparent));
256 protected override void Update(
float deltaTime)
259 base.Update(deltaTime);
273 holdTimer += deltaTime;
338 ? Color.Green * 0.33f
349 pulseTimer += deltaTime;
350 if (pulseTimer > 1.0f)
358 pulseExpand += deltaTime;
359 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