A scaled value, which is used by ScaledRect. More...
Public Member Functions | |
ScaledValue (ValueScale scale, float value) | |
Initializes a new ScaledValue. More... | |
ScaledValue (ScaledValue source) | |
Copy constructor. More... | |
ScaledValue () | |
Default constructor. More... | |
float | GetPixelValue (float windowSize) |
Gets the pixel value of this ScaledValue. More... | |
Static Public Member Functions | |
static ScaledValue | FromPixelValue (float value) |
Static utility function to create a ScaledValue from a pixel value. More... | |
static ScaledValue | FromNormalizedValue (float value) |
Static utility function to create a ScaledValue from a normalized value. More... | |
Public Attributes | |
ValueScale | scale |
The scale used by the value (pixel-scale or normalized-scale). More... | |
float | value |
The value in the scale. More... | |
Static Public Attributes | |
static readonly ScaledValue | zero = new ScaledValue(ValueScale.Pixel, 0) |
Represents a length of zero. More... | |
static readonly ScaledValue | max = new ScaledValue(ValueScale.Normalized, 1) |
Represents a length equal to the size of the window. More... | |
A scaled value, which is used by ScaledRect.
The value can be scaled in pixel measurements or normalized [0,,1] to the size of the window/screen.
PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.ScaledValue | ( | ValueScale | scale, |
float | value | ||
) |
Initializes a new ScaledValue.
scale | Scale to use. |
value | Value to use. |
PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.ScaledValue | ( | ScaledValue | source | ) |
PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.ScaledValue | ( | ) |
Default constructor.
|
static |
Static utility function to create a ScaledValue from a normalized value.
value | The normalized value. |
|
static |
Static utility function to create a ScaledValue from a pixel value.
value | The pixel value. |
float PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.GetPixelValue | ( | float | windowSize | ) |
Gets the pixel value of this ScaledValue.
windowSize | For normalized values, windowSize is the pixel value represented by the normalized value 1 . |
|
static |
Represents a length equal to the size of the window.
If the window is the whole screen, this value is Screen.width
for horizontal values or Screen.height
for vertical values.
ValueScale PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.scale |
The scale used by the value (pixel-scale or normalized-scale).
float PixelCrushers.DialogueSystem.UnityGUI.ScaledValue.value |
The value in the scale.
|
static |
Represents a length of zero.