mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
refactor
This commit is contained in:
parent
d74b6ca91c
commit
3d0e31b102
11 changed files with 194 additions and 153 deletions
|
|
@ -235,17 +235,20 @@ Properties:
|
|||
|
||||
Properties:
|
||||
|
||||
| Name | Type | Read | Write | Description |
|
||||
|------------|--------|------|-------|---------------------------------------------------------------|
|
||||
| value | float | yes | yes | current value |
|
||||
| min | float | yes | yes | minimum value |
|
||||
| max | float | yes | yes | maximum value |
|
||||
| progress | float | yes | no | progress 0..1 |
|
||||
| barColor | rgba | yes | yes | color of the filled part |
|
||||
| bgColor | rgba | yes | yes | background color (empty part) |
|
||||
| textColor | rgba | yes | yes | text color |
|
||||
| textFormat | string | yes | yes | text format (sprintf: `%1$` — raw value, `%2$` — percent 0–100) |
|
||||
| smooth | bool | yes | yes | smooth value change |
|
||||
| Name | Type | Read | Write | Description |
|
||||
|--------------|--------|------|-------|---------------------------------------------------------------|
|
||||
| value | float | yes | yes | current value |
|
||||
| min | float | yes | yes | minimum value |
|
||||
| max | float | yes | yes | maximum value |
|
||||
| progress | float | yes | no | progress 0..1 |
|
||||
| displayValue | float | yes | no | displayed (animated) value |
|
||||
| color | rgba | yes | yes | color of the filled part |
|
||||
| bgColor | rgba | yes | yes | background color (empty part) |
|
||||
| textColor | rgba | yes | yes | text color |
|
||||
| text | string | yes | yes | text centered in the bar |
|
||||
| smooth | bool | yes | yes | smooth value change |
|
||||
| smoothSpeed | number | yes | yes | smooth transition speed in units per second |
|
||||
| orientation | string | yes | yes | fill direction: "horizontal" / "vertical" |
|
||||
|
||||
## Inventory
|
||||
|
||||
|
|
|
|||
|
|
@ -200,18 +200,13 @@ Non-interactive element for displaying progress. Draws a background and a filled
|
|||
- `min` - minimal value. Type: number. Default: 0
|
||||
- `max` - maximal value. Type: number. Default: 100
|
||||
- `value` - initial value. Type: number. Default: 0
|
||||
- `bar-color` - color of the filled part. Type: RGBA color. Default: blue `#3399FFCC`
|
||||
- `color` - color of the filled part. Type: RGBA color. Default: blue `#3399FFCC`
|
||||
- `bg-color` - background color (empty part). Type: RGBA color. Default: semi-transparent black `#00000066`
|
||||
- `orientation` - fill direction: `horizontal` / `vertical`
|
||||
- `supplier` - Lua function - value supplier, called every frame
|
||||
- `smooth` - smooth value change on updates. Type: boolean. Default: false
|
||||
- `text-format` - format of the text centered in the bar (sprintf, two arguments: `%1$` - raw value, `%2$` - percent 0-100)
|
||||
```xml
|
||||
<progressbar value='35' min='10' max='50' text-format='%.0f%%'/> <!-- "62%" -->
|
||||
<progressbar value='35' min='10' max='50' text-format='%.0f (%.0f%%)'/> <!-- "35 (62%)" -->
|
||||
<progressbar value='35' min='10' max='50' text-format='%2$.0f%%'/> <!-- "62%" -->
|
||||
```
|
||||
- `smooth-speed` - smooth transition speed in units per second. Type: number. Default: 120
|
||||
- `text-color` - text color. Type: RGBA color. Default: white `#FFFFFFFF`
|
||||
- `font` - font name. Type: string. Default: "normal"
|
||||
|
||||
## *bindbox*
|
||||
|
||||
|
|
|
|||
|
|
@ -235,17 +235,20 @@ Canvas.decode(data: Bytearray, format: str) -> Canvas
|
|||
|
||||
Свойства:
|
||||
|
||||
| Название | Тип | Чтение | Запись | Описание |
|
||||
| ---------- | ------ | ------ | ------ | ---------------------------------------------------------------------- |
|
||||
| value | float | да | да | текущее значение |
|
||||
| min | float | да | да | минимальное значение |
|
||||
| max | float | да | да | максимальное значение |
|
||||
| progress | float | да | нет | прогресс 0..1 |
|
||||
| barColor | rgba | да | да | цвет заполненной части |
|
||||
| bgColor | rgba | да | да | цвет фона (пустой части) |
|
||||
| textColor | rgba | да | да | цвет текста |
|
||||
| textFormat | string | да | да | формат текста (sprintf: `%1$` — сырое значение, `%2$` — процент 0–100) |
|
||||
| smooth | bool | да | да | плавное изменение значения |
|
||||
| Название | Тип | Чтение | Запись | Описание |
|
||||
|--------------|--------|--------|--------|------------------------------------------------------------------------|
|
||||
| value | float | да | да | текущее значение |
|
||||
| min | float | да | да | минимальное значение |
|
||||
| max | float | да | да | максимальное значение |
|
||||
| progress | float | да | нет | прогресс 0..1 |
|
||||
| displayValue | float | да | нет | отображаемое (анимированное) значение |
|
||||
| color | rgba | да | да | цвет заполненной части |
|
||||
| bgColor | rgba | да | да | цвет фона (пустой части) |
|
||||
| textColor | rgba | да | да | цвет текста |
|
||||
| text | string | да | да | текст по центру бара |
|
||||
| smooth | bool | да | да | плавное изменение значения |
|
||||
| smoothSpeed | number | да | да | скорость плавного перехода в единицах в секунду |
|
||||
| orientation | string | да | да | направление заполнения: "horizontal" / "vertical" |
|
||||
|
||||
## Инвентарь (inventory)
|
||||
|
||||
|
|
|
|||
|
|
@ -201,18 +201,13 @@
|
|||
- `min` — минимальное значение. Тип: число. По-умолчанию: 0
|
||||
- `max` — максимальное значение. Тип: число. По-умолчанию: 100
|
||||
- `value` — начальное значение. Тип: число. По-умолчанию: 0
|
||||
- `bar-color` — цвет заполненной части. Тип: RGBA цвет. По-умолчанию: синий `#3399FFCC`
|
||||
- `color` — цвет заполненной части. Тип: RGBA цвет. По-умолчанию: синий `#3399FFCC`
|
||||
- `bg-color` — цвет фона (пустой части). Тип: RGBA цвет. По-умолчанию: чёрный полупрозрачный `#00000066`
|
||||
- `orientation` — направление заполнения: `horizontal` / `vertical`
|
||||
- `supplier` — Lua-функция-поставщик значения, вызывается каждый кадр
|
||||
- `smooth` — плавное изменение значения при обновлениях. Тип: логический. По-умолчанию: false
|
||||
- `text-format` — формат текста по центру бара (sprintf, два аргумента: `%1$` — сырое значение, `%2$` — процент 0–100)
|
||||
```xml
|
||||
<progressbar value='35' min='10' max='50' text-format='%.0f%%'/> <!-- "62%" -->
|
||||
<progressbar value='35' min='10' max='50' text-format='%.0f (%.0f%%)'/> <!-- "35 (62%)" -->
|
||||
<progressbar value='35' min='10' max='50' text-format='%2$.0f%%'/> <!-- "62%" -->
|
||||
```
|
||||
- `smooth-speed` — скорость плавного перехода в единицах в секунду. Тип: число. По-умолчанию: 120
|
||||
- `text-color` — цвет текста. Тип: RGBA цвет. По-умолчанию: белый `#FFFFFFFF`
|
||||
- `font` — имя шрифта. Тип: строка. По-умолчанию: "normal"
|
||||
|
||||
## Привязка ввода - *bindbox*
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue