1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02:00

Rewrite the gamebar (#13768)

This commit is contained in:
Gregor Parzefall
2023-09-02 23:02:02 +02:00
committed by GitHub
parent 294ad98776
commit 83b85ba16a
4 changed files with 108 additions and 150 deletions

View File

@@ -126,30 +126,27 @@ members:
File: fst/buttonbar.lua
-----------------------
buttonbar_create(name, cbf_buttonhandler, pos, orientation, size)
buttonbar_create(name, pos, size, bgcolor, cbf_buttonhandler)
^ create a buttonbar
^ name: name of component (unique per ui)
^ cbf_buttonhandler: function to be called on button pressed
function(buttonbar,buttonname,buttondata)
^ pos: position relative to upper left of current shown formspec
{
x,
y
}
^ orientation: "vertical" or "horizontal"
^ size: size of bar
{
width,
height
x,
y
}
^ bgcolor: background color as `ColorString`
^ cbf_buttonhandler: function to be called on button pressed
function(fields)
Class reference buttonbar:
methods:
- add_button(btn_id, caption, button_image)
- set_parent(parent)
^ set parent to attach a buttonbar to
^ parent: component to attach to
- add_button(name, caption, image, tooltip)
- show()
^ show buttonbar
- hide()