A scaled value, which is used by ScaledRect. More...
Public Member Functions | |
ScaledValue (ValueScale scale, float value) | |
Initializes a new ScaledValue. | |
ScaledValue (ScaledValue source) | |
Copy constructor. | |
ScaledValue () | |
Default constructor. | |
float | GetPixelValue (float windowSize) |
Gets the pixel value of this ScaledValue. | |
Static Public Member Functions | |
static ScaledValue | FromPixelValue (float value) |
Static utility function to create a ScaledValue from a pixel value. | |
static ScaledValue | FromNormalizedValue (float value) |
Static utility function to create a ScaledValue from a normalized value. | |
Public Attributes | |
ValueScale | scale |
The scale used by the value (pixel-scale or normalized-scale). | |
float | value |
The value in the scale. | |
Static Public Attributes | |
static readonly ScaledValue | zero = new ScaledValue(ValueScale.Pixel, 0) |
Represents a length of zero. | |
static readonly ScaledValue | max = new ScaledValue(ValueScale.Normalized, 1) |
Represents a length equal to the size of the window. | |
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.
|
inline |
Initializes a new ScaledValue.
scale | Scale to use. |
value | Value to use. |
|
inline |
Copy constructor.
Initializes a new ScaledValue.
source | Source to copy. |
|
inline |
Default constructor.
|
inlinestatic |
Static utility function to create a ScaledValue from a normalized value.
value | The normalized value. |
|
inlinestatic |
Static utility function to create a ScaledValue from a pixel value.
value | The pixel value. |
|
inline |
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.