1 using Microsoft.Xna.Framework;
10 private float lifeTime;
18 get {
return coloredText.
Text; }
23 get {
return coloredText.
Color; }
49 get {
return lifeTime; }
74 coloredText =
new ColoredText(text, color,
false,
false);
75 this.lifeTime = lifeTime;
78 size = font.MeasureString(text);
79 Origin =
new Vector2(0, size.Y * 0.5f);
84 public GUIMessage(
string text, Color color, Vector2 position, Vector2 velocity,
float lifeTime, Alignment textAlignment = Alignment.Center,
GUIFont font =
null,
Submarine sub =
null)
86 coloredText =
new ColoredText(text, color,
false,
false);
91 this.lifeTime = lifeTime;
97 Origin =
new Vector2((
int)(0.5f * size.X), (
int)(0.5f * size.Y));
98 if (textAlignment.HasFlag(Alignment.Left))
101 if (textAlignment.HasFlag(Alignment.Right))
102 Origin.X += size.X * 0.5f;
104 if (textAlignment.HasFlag(Alignment.Top))
105 Origin.Y -= size.Y * 0.5f;
107 if (textAlignment.HasFlag(Alignment.Bottom))
108 Origin.Y += size.Y * 0.5f;
Vector2 MeasureString(LocalizedString str, bool removeExtraSpacing=false)
GUIMessage(string text, Color color, Vector2 position, Vector2 velocity, float lifeTime, Alignment textAlignment=Alignment.Center, GUIFont font=null, Submarine sub=null)
GUIMessage(string text, Color color, float lifeTime, GUIFont font=null)