Class: UIInputSlider
The `UIInputSlider` is a class that represents a slider input widget with methods to
set the value, minimum and maximum values, and step value.
It emit 'E_VALUE_CHANGED' when value changed.
Constructors
- new UIInputSlider(): UIInputSlider
The constructor.
Methods
- animate(animation: string): void
The "animate" function trigger animation to the widget `node` HTMLElement.
- animation: The `animation` parameter is a string that represents the name of the
animation to be applied to the `node` HTMLElement.
- appendChild(child: HTMLElement): void
The "appendChild" function appends a given HTML element as a child to the widget node.
- child: The `child` parameter is an instance of the `HTMLElement` class. It
represents an HTML element that you want to append to the widget node.
- appendStyles(styles: string): void
The "appendStyles" function appends CSS styles to the `node` HTMLElement.
- styles: The `styles` parameter is a string that represents CSS styles that you want
to append to the `cssText` property of the `node` object.
- delete(): void
The "delete" function free all resources.
Warning: you need to call this method to free allocation for this object.
- focus(): void
The "focus" function adds `u-focused` class to the `node` HTMLElement.
It emits a 'E_FOCUSED' event and subscribes to input action event.
- getId(): string
- getNode(): HTMLDivElement
The "getNode" function returns the root `node` HTMLElement of the widget.
- getPosition(): vec2
The "getPosition" function returns the relative x and y coordinates of the widget `node` HTMLElement.
- getScreenPosition(): vec2
The "getScreenPosition" function returns the left and top coordinates of the widget `node` HTMLElement on
the screen.
- isEnabled(): boolean
The "isEnabled" function checks if widget is enabled or not.
- isFocused(): boolean
The "isFocused" function checks if widget is focused.
- isSelected(): boolean
The "isSelected" function checks if widget is selected or not.
- isVisible(): boolean
The "isVisible" function checks if the widget is visible.
- onAction(actionId: string): void
The "onAction" function.
It emits an event with the name 'E_VALUE_CHANGED' if the actionId is 'LEFT' or 'RIGHT'.
- removeChild(index: number): void
The "removeChild" function removes a child element from the widget node.
- index: The index parameter is the position of the child element that you want to
remove from the widget node.
- setEnabled(enabled: boolean): void
The "setEnabled" function sets the enabled state flag.
It is just to expose a convenient option to the user, this flag has not effect on the UI manager.
Nota bene: toggle the `u-disabled` class on `node`.
- enabled: The `enabled` parameter is a boolean value that determines whether the
widget is enabled or disabled.
- setId(id: string): void
The "setId" function sets the id property.
- id: A string representing the unique identifier to be set.
- setMax(max: number): void
The "setMax" function sets the maximum value for the range input.
- max: The `max` parameter is a number that represents the maximum value for the range input.
- setMin(min: number): void
The "setMin" function sets the minimum value for the range input.
- min: The `min` parameter is a number that represents the minimum value for the range input.
- setPosition(x: number, y: number): void
The "setPosition" function sets the left and top position to the widget `node` HTMLElement.
Nota bene: works only if position is `absolute`.
- x: The horizontal position of the element on the page.
- y: The vertical position of the element on the page.
- setSelected(selected: boolean): void
The "setSelected" function sets the selected state flag.
It is just to expose a convenient option to the user, this flag has not effect on the UI manager.
Nota bene: toggle the `u-selected` class on `node`.
- selected: The `selected` parameter is a boolean value that indicates whether the
element should be selected or not.
- setStep(step: number): void
The "setStep" function sets the step value for the range input.
- step: The `step` parameter is a number that represents the increment or decrement
value for the range input.
- setValue(value: number): void
The "setValue" function sets the input value.
- value: The `value` parameter is a number that represents the new value to be set.
- setVisible(visible: boolean): void
The "setVisible" function sets the visibility state.
Nota bene: toggle the `u-hidden` class on `node`.
- visible: The `visible` parameter is a boolean value that determines whether the
element should be visible or hidden. If `visible` is true, the element will be displayed, otherwise
it will be hidden.
- unfocus(): void
The "unfocus" function removes the `u-focused` class from the `node` HTMLElement.
It emits an 'E_UNFOCUSED' event and unsubscribes the inputManager from input action event.
- update(ts: number): void
The "update" function.
- ts: The `ts` parameter stands for "timestep".