Struct Size
Allow representing different kinds of sizes, e.g. absolute or relative.
For convenience float will be implicitly converted to an absolute size,
so any parameter expecting a Size can simply be passed a float value.
public struct Size
Constructors
Size(SizeMode, float)
Size(SizeMode, float, float)
public Size(SizeMode mode, float value, float maxSize)
Parameters
Fields
maxSize
mode
value
The raw size value. What this represents depends on the mode
of the size.
For relative size the value represents
a percentage.
public float value
Field Value
Methods
Auto(float, float)
A convenience method for creating an Auto size.
public static Size Auto(float percent, float maxSize = 0)
Parameters
Returns
Relative(float)
A convenience method for creating a Relative size.
public static Size Relative(float percent)
Parameters
percentfloat
Returns
ToAbsolute()
Changes this Size to Absolute, without altering its value.
public void ToAbsolute()
ToAuto()
Changes this Size to Auto, without altering its value.
public void ToAuto()
ToRelative()
Changes this Size to Auto, without altering its value.
public void ToRelative()