Class ValueAndUnit
Hierarchy
- ValueAndUnit
Index
Constructors
constructor
Creates a new ValueAndUnit
Parameters
value: number
defines the value to store
Optional unit: number
defines the unit to store - defaults to ValueAndUnit.UNITMODE_PIXEL
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
on Changed ObservableSearch playground for onChangedObservable
BABYLON.Observable event triggered each time the value or unit changes
Accessors
internal Value
Gets value (without units)
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
unit
Gets units (without value)
Returns number
Sets units (without value)
Parameters
value: number
Returns void
value
Gets value (without units)
Returns number
Sets value (without units)
Parameters
value: number
Returns void
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 and updated
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 In PixelSearch 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 In PlaceSearch playground for updateInPlace
Update the current value and unit.
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