Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/doc/lua/openstarbound/widget.md
blob: 288c8992679fdf20466d2c2e63408f248e6bc386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Widget

New widget callbacks introduced in OpenStarbound.

## General callbacks

These callbacks are available for all widgets.

---

## Widget specific callbacks

These callbacks only work for some widget types.

---

#### `String` widget.getHint(`String` widgetName)

Gets the hint text of a TextBoxWidget.

#### `void` widget.setHint(`String` widgetName, `String` hint)

Sets the hint text of a TextBoxWidget.

---

#### `String` widget.getCursorPosition(`String` widgetName)

Gets the cursor position of a TextBoxWidget.

#### `void` widget.setCursorPosition(`String` widgetName, `int` cursorPosition)

Sets the cursor position of a TextBoxWidget.

---

#### `void` widget.setImageStretchSet(`String` widgetName, `Json` imageStretchSet)

Sets the full image set of a ImageStretchWidget.

```
{
  begin = "image.png",
  inner = "image.png",
  end = "image.png"
}
```