Name | Type | Default | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
number | The x coords | |||||||||||||||||||||||||||||||||
y |
number | The y coords | |||||||||||||||||||||||||||||||||
w |
number | The w coords | |||||||||||||||||||||||||||||||||
h |
number | The h coords | |||||||||||||||||||||||||||||||||
listContents |
Array.<Object> | List of all the contents to display | |||||||||||||||||||||||||||||||||
opts |
Object | {} |
optional
Options
|
Properties:
Name | Type | Description |
---|---|---|
listContents |
Array.<Object> | List of all the graphic contents to display |
listCallbacks |
Array.<function()> | List of all the callback functions to excecute when pressed. |
orientation |
OrientationWindow | The orientation of the window (horizontal or vertical) |
nbItemsMax |
number | Max number of items to display on the choice box |
padding |
Array.<number> | Padding of the box |
space |
number | Space between each choice in the box |
currentSelectedIndex |
number | The current selected index position in the choice box |
bordersInsideVisible |
boolean | If checked, each choice will have an individual window box |
offsetSelectedIndex |
number | offset index position when going out of the total box size |
choiceWidth |
number | A choice box width |
choiceHeight |
number | A choice box height |
startTime |
number | A time variable used for delaying going up/down while keeping keyboard pressed |
size |
number | Max number of choices according to max number + current number |
windowMain |
WindowBox | The main window box when there is no border inside |
listWindows |
Array.<WindowBox> | List of all the windows to display |
Extends
Members
-
Number of milliseconds to wait before going up/down when keypress repeat
- Default Value:
- 50
Methods
-
setX (x) overrides
-
Set the x value
Name Type Description x
number The x value -
setY (y) overrides
-
Set the y value
Name Type Description y
number The y value -
Get the content at a specific index
Name Type Description i
number The index Returns:
Type Description Object -
Get the current selected content
Returns:
Type Description Object -
Update content size according to all the current settings
Name Type Default Description currentSelectedIndex
number 0 optional The current selected index position -
Set the content at a specific index
Name Type Description i
number The index content
Object The new content -
Set all the graphic contents
Name Type Description contents
Array.<Object> All the contents -
Set all the callbacks for each choice
Name Type Description callbacks
Array.<function()> All the callbacks functions -
Set all the contents and callbacks
Name Type Default Description contents
Array.<Object> All the contents callbacks
Array.<function()> null optional All the callbacks functions currentSelectedIndex
number 0 optional The current selected index position -
Unselect a choice
-
Select a choice
Name Type Description i
number The index of the choice -
Select the current choice
-
Go cursor up
-
Go cursor down
-
First key press handle
Name Type Description key
number The key ID pressed base
Object The base object to apply with callback -
Key pressed repeat handle, but with a small wait after the first pressure (generally used for menus)
Name Type Description key
number The key ID pressed Returns:
Type Description boolean false if the other keys are blocked after it -
Draw the windows
-
Set the w value
Name Type Default Description w
number The w value min
boolean false optional If checked, transform screen value with min x y -
Set the h value
Name Type Default Description h
number The h value min
boolean false optional If checked, transform screen value with min x y -
Set the position to the left
-
Set the position to the top
-
Set the position to the right
-
Set the position to the bot
-
Set all the coords values
Name Type Description x
number The x value y
number The y value w
number The w value h
number The h value