Class ValueAndUnit
Hierarchy
- ValueAndUnit
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates a new ValueAndUnit
Parameters
-
value: number
defines the value to store
-
Optional unit: number
defines the unit to store
-
Optional negativeValueAllowed: boolean
defines a boolean indicating if the value can be negative
Returns ValueAndUnit
-
Properties
ignore Adaptive ScalingSearch playground for ignoreAdaptiveScaling
Gets or sets a value indicating that this value will not scale accordingly with adaptive scaling property
negative Value AllowedSearch playground for negativeValueAllowed
defines a boolean indicating if the value can be negative
unitSearch playground for unit
defines the unit to store
Accessors
internal Value
-
Gets direct internal value
Returns number
is Percentage
-
Gets a boolean indicating if the value is a percentage
Returns boolean
is Pixel
-
Gets a boolean indicating if the value is store as pixel
Returns boolean
Static UNITMODE_ PERCENTAGE
-
UNITMODE_PERCENTAGE
Returns number
Static UNITMODE_ PIXEL
-
UNITMODE_PIXEL
Returns number
Methods
from StringSearch playground for fromString
-
Store a value parsed from a string
Parameters
-
source: string | number
defines the source string
Returns boolean
true if the value was successfully parsed
-
get ValueSearch playground for getValue
-
Gets the value accordingly to its unit
Parameters
-
host: AdvancedDynamicTexture
defines the root host
Returns number
the value
-
get Value InPixelSearch playground for getValueInPixel
-
Gets value as pixel
Parameters
-
host: AdvancedDynamicTexture
defines the root host
-
refValue: number
defines the reference value for percentages
Returns number
the value as pixel
-
to StringSearch playground for toString
-
Gets a string representation of the value
Parameters
-
host: AdvancedDynamicTexture
defines the root host
-
Optional decimals: number
defines an optional number of decimals to display
Returns string
a string
-
update InPlaceSearch playground for updateInPlace
-
Update the current value and unit. This should be done cautiously as the GUi won't be marked as dirty with this function.
Parameters
-
value: number
defines the value to store
-
Optional unit: number
defines the unit to store
Returns ValueAndUnit
the current ValueAndUnit
-
Class used to specific a value and its associated unit