Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CalculatedStyle.cs
Go to the documentation of this file.
2
3namespace Terraria.UI;
4
5public struct CalculatedStyle
6{
7 public float X;
8
9 public float Y;
10
11 public float Width;
12
13 public float Height;
14
15 public CalculatedStyle(float x, float y, float width, float height)
16 {
17 X = x;
18 Y = y;
19 Width = width;
20 Height = height;
21 }
22
24 {
25 return new Rectangle((int)X, (int)Y, (int)Width, (int)Height);
26 }
27
29 {
30 return new Vector2(X, Y);
31 }
32
33 public Vector2 Center()
34 {
35 return new Vector2(X + Width * 0.5f, Y + Height * 0.5f);
36 }
37}
CalculatedStyle(float x, float y, float width, float height)