Progress:

- Input fields for vectors & colors in SerializableEntityEditor.
- SerializableProperty tooltips.
- GUINumberInput supports floats.
- EditingHUD for structures (atm the only editable property is the color of the sprite)
This commit is contained in:
Joonas Rikkonen
2017-11-12 20:24:11 +02:00
parent 8e556f1c76
commit f7298c241e
15 changed files with 514 additions and 130 deletions
@@ -72,11 +72,17 @@ namespace Barotrauma
child.Rect = new Rectangle(child.Rect.X + value.X - rect.X, child.Rect.Y + value.Y - rect.Y, child.Rect.Width, child.Rect.Height);
}
Point moveAmount = value.Location - rect.Location;
rect = value;
if (value.Width != rect.Width || value.Height != rect.Height)
{
SetTextPos();
}
else if (moveAmount != Point.Zero)
{
caretPos += moveAmount.ToVector2();
}
}
}
@@ -240,7 +246,6 @@ namespace Barotrauma
{
caretPos = new Vector2(rect.X + size.X, rect.Y) + textPos - origin;
}
}
private Vector2 MeasureText(string text)
@@ -257,6 +262,12 @@ namespace Barotrauma
return size;
}
protected override void SetAlpha(float a)
{
base.SetAlpha(a);
textColor = new Color(textColor.R, textColor.G, textColor.B, a);
}
public override void Draw(SpriteBatch spriteBatch)
{
Draw(spriteBatch, Vector2.Zero);