From 41ec44b6ee7ffd86327aa3a2db3e9267c900d745 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 17 Apr 2025 20:05:09 +0300 Subject: [PATCH] update doc/*/scripting/ui.md --- doc/en/scripting/ui.md | 37 ++++++++++++++++++++----------------- doc/ru/scripting/ui.md | 37 ++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/doc/en/scripting/ui.md b/doc/en/scripting/ui.md index 771049c5..c649fadc 100644 --- a/doc/en/scripting/ui.md +++ b/doc/en/scripting/ui.md @@ -28,27 +28,30 @@ For example: document["worlds-panel"]:clear() ``` +Access to nested elements is performed by index (starting from one). + ## General properties and methods Properties that apply to all elements: -| Name | Type | Read | Write | Description | -| ------------- | ------ | ---- | ----- | ------------------------------------------- | -| id | string | yes | *no* | element id | -| pos | vec2 | yes | yes | element position inside a container | -| wpos | vec2 | yes | yes | element position inside the window | -| size | vec2 | yes | yes | element size | -| interactive | bool | yes | yes | ability to interact with the element | -| enabled | bool | yes | yes | visually indicated version of *interactive* | -| visible | bool | yes | yes | element visibility | -| focused | bool | yes | yes | focus on element | -| color | rgba | yes | yes | element color | -| hoverColor | rgba | yes | yes | hover color | -| pressedColor | rgba | yes | yes | color when pressed | -| tooltip | string | yes | yes | tooltip text | -| tooltipDelay | float | yes | yes | tooltip delay | -| contentOffset | vec2 | yes | *no* | element content offset | -| cursor | string | yes | yes | cursor displayed on hover | +| Name | Type | Read | Write | Description | +| ------------- | ------- | ---- | ----- | ------------------------------------------- | +| id | string | yes | *no* | element id | +| pos | vec2 | yes | yes | element position inside a container | +| wpos | vec2 | yes | yes | element position inside the window | +| size | vec2 | yes | yes | element size | +| interactive | bool | yes | yes | ability to interact with the element | +| enabled | bool | yes | yes | visually indicated version of *interactive* | +| visible | bool | yes | yes | element visibility | +| focused | bool | yes | yes | focus on element | +| color | rgba | yes | yes | element color | +| hoverColor | rgba | yes | yes | hover color | +| pressedColor | rgba | yes | yes | color when pressed | +| tooltip | string | yes | yes | tooltip text | +| tooltipDelay | float | yes | yes | tooltip delay | +| contentOffset | vec2 | yes | *no* | element content offset | +| cursor | string | yes | yes | cursor displayed on hover | +| parent | Element | yes | *no* | parent element or nil | Common element methods: diff --git a/doc/ru/scripting/ui.md b/doc/ru/scripting/ui.md index f9d9ab00..918b77af 100644 --- a/doc/ru/scripting/ui.md +++ b/doc/ru/scripting/ui.md @@ -28,27 +28,30 @@ Id элемента не может быть изменен из скрипта. document["worlds-panel"]:clear() ``` +Доступ к вложенным элементам производится по индексу (с единицы). + ## Общие свойства и методы Свойства, относящиеся ко всем элементам: -| Название | Тип | Чтение | Запись | Описание | -| ------------- | ------ | ------ | ------ | ----------------------------------------- | -| id | string | да | *нет* | идентификатор элемента | -| pos | vec2 | да | да | позиция элемента внутри контейнера | -| wpos | vec2 | да | да | позиция элемента в окне | -| size | vec2 | да | да | размер элемента | -| interactive | bool | да | да | возможность взаимодействия с элементом | -| enabled | bool | да | да | визуально обозначаемая версия interactive | -| visible | bool | да | да | видимость элемента | -| focused | bool | да | да | фокус на элементе | -| color | rgba | да | да | цвет элемента | -| hoverColor | rgba | да | да | цвет при наведении | -| pressedColor | rgba | да | да | цвет при нажатии | -| tooltip | string | да | да | текст всплывающей подсказки | -| tooltipDelay | float | да | да | задержка всплывающей подсказки | -| contentOffset | vec2 | да | *нет* | смещение содержимого | -| cursor | string | да | да | курсор, отображаемый при наведении | +| Название | Тип | Чтение | Запись | Описание | +| ------------- | ------- | ------ | ------ | ----------------------------------------- | +| id | string | да | *нет* | идентификатор элемента | +| pos | vec2 | да | да | позиция элемента внутри контейнера | +| wpos | vec2 | да | да | позиция элемента в окне | +| size | vec2 | да | да | размер элемента | +| interactive | bool | да | да | возможность взаимодействия с элементом | +| enabled | bool | да | да | визуально обозначаемая версия interactive | +| visible | bool | да | да | видимость элемента | +| focused | bool | да | да | фокус на элементе | +| color | rgba | да | да | цвет элемента | +| hoverColor | rgba | да | да | цвет при наведении | +| pressedColor | rgba | да | да | цвет при нажатии | +| tooltip | string | да | да | текст всплывающей подсказки | +| tooltipDelay | float | да | да | задержка всплывающей подсказки | +| contentOffset | vec2 | да | *нет* | смещение содержимого | +| cursor | string | да | да | курсор, отображаемый при наведении | +| parent | Element | да | *нет* | родительский элемент или nil | Общие методы элементов: