position([x_or_position], [y], [right], [bottom])
Class: ProgressBar. Method inherited from UIComponent.
Description:
Sets or gets the position of the component relative to its parent component's top-let corner (or to the screen's top-left corner when component is Window).
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
number | Point |
X position. Alternatively, provide a single |
|
|
number |
Y position. |
|
|
number |
Resizes the component so that its right edge is this many pixels from the right edge of the parent component or screen. |
|
|
number |
Resizes the component so that its bottom edge is this many pixels from the bottom edge of the parent component or screen. |
Returns:
If no arguments are provided, returns a {x: number, y: number} position object. Otherwise, returns this component.
Type: Point | this
Examples:
panel.size(50, 100); // sets position
panel.size({x: 50, y: 100}); // sets position
panel.size(50, 100, 20); // sets position of left, top and right sides relative to sides of parent component.
const window = new Window("New Window").size(50, 100, 20, 20); // sets position of each side relative to sides of screen.
