DOCS updated

master
Zughy 2020-11-29 00:21:18 +01:00
parent 587da73726
commit ba06bf799b
1 changed files with 4 additions and 4 deletions

View File

@ -6,20 +6,20 @@ A panel is a custom object made of 2 HUD elements, the title and the background,
### 1.1. Declaration
To declare a new panel, simply do
`local panel = Panel:new({parameters})`
`local panel = Panel:new(name, {parameters})`
The parameters it takes are the following:
* `name`: required. The panel name. Used to retrieve it via `panel_lib.get_panel(player_name, panel_name)`.
* `player`: required. The player to assign the panel to
* `position`: the panel position (as in any other HUD)
* `alignment`: same
* `bg`: the picture to put in the background
* `bg_scale`: its scaling
* `title`: the default text
* `title`: the default text. Default is empty (`""`)
* `title_size`: (table) as a multiplier, where Y is not considered. Ie. `{ x = 2}` will double up the font size
* `title_alignment`
* `title_offset`
* `title_color`
* `visible`: (bool) whether the panel is visible right after its creation. Default is `true`
* `sub_img_elems`: (table) whatever image to add to the panel
* `sub_txt_elems`: (table) whatever text to add to the panel
@ -39,7 +39,7 @@ Install it as any other mod `¯\_(ツ)_/¯`
* `new({params})`: creates a new panel
* `show()`: makes the panel appear
* `hide()`: makes the panel disappear (but it's still assigned to the player)
* `is_shown()`: whether the panel is currently displayed
* `is_visible()`: whether the panel is currently displayed
* `remove()`: deletes it
* `update(panel_params, txt_elems, img_elems)`: updates only the mentioned parameters. For instance, calling