UI
UI is one of the basic elements in the project and one of the important ways for players to interact with the game.
Functions
get_lua_ui_from_py
Obtain the interface instance of the lua layer through the interface instance of the py layer.
Parameters
Variable | Type | Description |
---|---|---|
py_ui | string |
Return
Type | Description |
---|---|
table | Returns the lua layer skill instance after the lua layer is initialized. |
ui.get_lua_ui_from_py (player, py_ui)
create_ui_widget
Create interface controls.
Parameters
Variable | Type | Description |
---|---|---|
player | string | Player. |
parent_ui | string | Ui control. |
type_name | string | Ui control. |
Return
Type | Description |
---|---|
table | Returns the lua layer skill instance after the lua layer is initialized. |
ui.create_ui_widget (player, parent_ui, type_name)
set_visible
Set the UI control to be visible or hidden.
Parameter
Variable | Type | Description |
---|---|---|
visible | boolean | Show/hide. |
ui:set_visible (visible)
set_image
Set picture.
Parameter
Variable | Type | Description |
---|---|---|
img | integer | Image ID. |
ui:set_image (img)
set_text
Set text.
Parameter
Variable | Type | Description |
---|---|---|
str | string | Text. |
ui:set_text (str)
set_alpha
Set the transparency of the control.
Parameter
Variable | Type | Description |
---|---|---|
value | float | Transparency. |
ui:set_alpha (value)
set_is_draggable
Set whether the control can be dragged.
Parameter
Variable | Type | Description |
---|---|---|
isdrag | boolean | Whether draggable. |
ui:set_is_draggable (isdrag)
set_intercepts_operations
Set whether the control intercepts the operation.
Parameter
Variable | Type | Description |
---|---|---|
intercepts | boolean | Whether to intercept the operation. |
ui:set_intercepts_operations (intercepts)
set_z_order
Set control depth.
Parameter
Variable | Type | Description |
---|---|---|
deep | float | Depth. |
ui:set_z_order (deep)
set_max_progress_bar_value
Set the maximum value of the progress bar.
Parameter
Variable | Type | Description |
---|---|---|
progress | float | Maximum value of the progress bar. |
ui:set_max_progress_bar_value (progress)
set_current_progress_bar_value
Set the current value of the progress bar.
Parameters
Variable | Type | Description |
---|---|---|
progress | float | Current value of the progress bar. |
time | float | Fade time. |
ui:set_current_progress_bar_value (progress, time)
set_button_enable
Enable/disable button.
Parameter
Variable | Type | Description |
---|---|---|
enable | boolean | Enable/disable button. |
ui:set_button_enable (enable)
set_ui_size
Set control size.
Parameters
Variable | Type | Description |
---|---|---|
width | float | Width. |
height | float | Height. |
ui:set_ui_size (width, height)
set_font_size
Set text font size.
Parameter
Variable | Type | Description |
---|---|---|
size | float | Font size. |
ui:set_font_size (size)
set_input_field_focus
Let the input box get the focus.
ui:set_input_field_focus ()
set_skill_on_ui_comp
Bind the skill object to the control.
Parameter
Variable | Type | Description |
---|---|---|
skill | ability | Skill object. |
ui:set_skill_on_ui_comp (skill)
set_buff_on_ui
Bind the unit to the magic effect display bar component.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
ui:set_buff_on_ui (unit)
set_item_on_ui
Bind the item object to the item component.
Parameter
Variable | Type | Description |
---|---|---|
item | item | Item object. |
ui:set_item_on_ui (item)
set_prefab_ui_visible
Set the switch of the default game interface.
Parameter
Variable | Type | Description |
---|---|---|
visible | boolean | Switch of the game interface. |
ui:set_prefab_ui_visible (visible)
set_ui_model_id
Set the model of the model control.
Parameter
Variable | Type | Description |
---|---|---|
modelid | string | Model ID. |
ui:set_ui_model_id (modelid)
change_mini_map_img
Change minimap image.
Parameter
Variable | Type | Description |
---|---|---|
img | string | Image ID. |
ui:change_mini_map_img (img)
set_ui_unit_slot
Set the item component binding unit.
Parameters
Variable | Type | Description |
---|---|---|
unit | unit | Picture id. |
field | string | Backpack slot type name. |
index | integer | Grid position. |
ui:set_ui_unit_slot (unit, field, index)
set_button_shortcut
Set button shortcuts.
Parameter
Variable | Type | Description |
---|---|---|
key | string | Shortcut key. |
ui:set_button_shortcut (key)
set_btn_meta_key
Set button combination shortcut key.
Parameter
Variable | Type | Description |
---|---|---|
key | string | Auxiliary key. |
ui:set_btn_meta_key (key)
set_skill_btn_smart_cast_key
Set smart casting shortcuts.
Parameter
Variable | Type | Description |
---|---|---|
key | string | Shortcut key. |
ui:set_skill_btn_smart_cast_key (key)
set_skill_btn_func_meta_key
Set shortcut keys for smart casting combinations.
Parameter
Variable | Type | Description |
---|---|---|
key | string | Auxiliary key. |
ui:set_skill_btn_func_meta_key (key)
set_skill_btn_action_effect
Play/stop skill button activates animation.
Parameter
Variable | Type | Description |
---|---|---|
isopen | boolean | Play/stop skill button activate animation. |
ui:set_skill_btn_action_effect (isopen)
set_text_color
Set text color.
Parameter
Variable | Type | Description |
---|---|---|
r | float | Red. |
g | float | Green. |
b | float | Blue. |
a | float | Opacity. |
ui:set_text_color (r, g, b, a)
change_showroom_fov
Set the camera field of view of the model control.
Parameter
Variable | Type | Description |
---|---|---|
fov | float | Field of view. |
ui:change_showroom_fov (fov)
change_showroom_cposition
Set the camera coordinates of the model control.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
z | float | Z axis. |
ui:change_showroom_cposition (x, y, z)
change_showroom_crotation
Set the camera rotation of the model control.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
z | float | Z axis. |
ui:change_showroom_crotation (x, y, z)
create_ui_event
Create interface events.
Parameters
Variable | Type | Description |
---|---|---|
event | float | Interface event type. |
str | string | Event name. |
ui:create_ui_event (event, str)
display_system_information_message
System message prompt.
Parameters
Variable | Type | Description |
---|---|---|
msg | string | Message. |
time | float | Duration. |
isSupportLanguage | boolean | Whether to support the language environment. |
ui:display_system_information_message (msg, time, isSupportLanguage)
set_widget_relative_rotation
Set the relative rotation of the control.
Parameter
Variable | Type | Description |
---|---|---|
rot | float | Angle. |
ui:set_widget_relative_rotation (rot)
set_widget_absolute_coordinates
Set the absolute coordinates of the control.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
ui:set_widget_absolute_coordinates (x, y)
set_widget_absolute_rotation
Set absolute rotation of the control.
Parameter
Variable | Type | Description |
---|---|---|
rot | float | Angle. |
ui:set_widget_absolute_rotation (rot)
set_widget_absolute_scale
Set the absolute scaling of the control.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
ui:set_widget_absolute_scale (x, y)
set_widget_relative_scale
Set the relative zoom of the control.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
ui:set_widget_relative_scale (x, y)
change_minimap_display_mode
Set the minimap display mode.
Parameter
Variable | Type | Description |
---|---|---|
type | string | Minimap display mode. |
ui:change_minimap_display_mode (type)
set_slider_value
Set the progress of the slider.
Parameter
Variable | Type | Description |
---|---|---|
percent | float | Progress of the slider. |
ui:set_slider_value (percent)
unbind_widget
Unbind controls.
ui:unbind_widget ()
get_ui_comp_children
Traverse the child nodes of an interface control.
get_ui_comp_children (self.player.base (), self.base ())
play_timeline_animation
Play timeline animation.
Parameters
Variable | Type | Description |
---|---|---|
anim | string | Animation. |
speed | float | Playback speed. |
isloop | boolean | Whether to loop. |
ui:play_timeline_animation (anim, speed, isloop)
set_ui_model_focus_pos
Set model control watchpoint.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
z | float | Z axis. |
ui:set_ui_model_focus_pos (x, y, z)
bind_unit_attribute_to_player_ui_widget_attribute
Binding unit properties to properties of player interface controls.
Parameters
Variable | Type | Description |
---|---|---|
uiAttr | string | Interface control attribute. |
attr | string | Unit attribute. |
accuracy | integer | Decimal precision. |
ui:bind_unit_attribute_to_player_ui_widget_attribute (uiAttr, attr, accuracy)
bind_global_variable_to_player_ui_widget_attribute
Binding global variables to properties of player interface controls.
Parameters
Variable | Type | Description |
---|---|---|
uiAttr | string | Interface control attribute. |
globalVar | string | Global attribute. |
accuracy | integer | Decimal precision. |
ui:bind_global_variable_to_player_ui_widget_attribute (uiAttr, globalVar, accuracy)
unbind_ui_widget_attribute
Unbind interface control property binding.
Parameter
Variable | Type | Description |
---|---|---|
uiAttr | string | Interface control attribute. |
ui:unbind_ui_widget_attribute (uiAttr)
ui_widget_attribute_bound_to_specified_unit
Interface control property binding specified unit.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
ui:ui_widget_attribute_bound_to_specified_unit (unit)
set_disable_image_type
Set disabled pictures (picture type).
Parameter
Variable | Type | Description |
---|---|---|
img | integer | Image ID. |
ui:set_disable_image_type (img)
set_hover_image_type
Set floating picture (picture type).
Parameter
Variable | Type | Description |
---|---|---|
img | integer | Image ID. |
ui:set_hover_image_type (img)
set_press_image_type
Set the pressed picture (picture type).
Parameter
Variable | Type | Description |
---|---|---|
img | integer | Image ID. |
ui:set_press_image_type (img)
bind_player_attribute_to_ui_widget_attribute
Bind player properties to properties of player interface controls.
Parameters
Variable | Type | Description |
---|---|---|
uiAttr | string | Interface control attribute. |
playerAttr | string | Player attribute. |
accuracy | integer | Decimal precision. |
ui:bind_player_attribute_to_ui_widget_attribute (uiAttr, playerAttr, accuracy)
set_alignment_type_for_ui_widget
Set the alignment of interface components.
Parameter
Variable | Type | Description |
---|---|---|
type | string | Alignment. |
ui:set_alignment_type_for_ui_widget (type)
enable_drawing_unit_path
Turn on drawing unit path lines.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
ui:enable_drawing_unit_path (unit)
disable_drawing_unit_path
Turn off drawing unit path lines.
Parameter
Variable | Type | Description |
---|---|---|
unit | unit | Unit. |
ui:disable_drawing_unit_path (unit)
remove_ui_comp
Delete interface controls.
ui:remove_ui_comp ()
set_ui_comp_bind_ability_cd
Binding skill cooldown time to the property of the player interface control.
Parameters
Variable | Type | Description |
---|---|---|
uiAttr | string | Interface control attribute. |
skill | ability | Skill. |
ui:set_ui_comp_bind_ability_cd (uiAttr, skill)
set_ui_comp_bind_modifier_cd
A property that binds the magic effect's remaining time to the player interface control.
Parameters
Variable | Type | Description |
---|---|---|
uiAttr | string | Interface control attribute. |
magicEffect | modifier | Magic effect. |
ui:set_ui_comp_bind_modifier_cd (uiAttr, magicEffect)
set_chat_send_enabled
Enable/disable send chat feature.
Parameter
Variable | Type | Description |
---|---|---|
enable | boolean | Enable/disable send chat function. |
game_api.set_chat_send_enabled (self.player.base (), self.base (), enable)
set_player_chat_show
Show/hide chat box.
Parameter
Variable | Type | Description |
---|---|---|
enable | boolean | Show/hide chat box. |
ui:set_player_chat_show (enable)
clear_player_chat_panel
Clear chat.
ui:clear_player_chat_panel ()
send_chat_to_role
Send private message.
Parameters
Variable | Type | Description |
---|---|---|
player | player | Player. |
msg | string | Message. |
game_api.send_chat_to_role (self.player.base (), self.base (), player.base (), msg)
create_floating_text
Create floating text.
Parameters
Variable | Type | Description |
---|---|---|
point | point | Point. |
harm_type_name | string | Skip word type. |
str | string | Text. |
player_group | player_group | Player group. |
ui.create_floating_text (point, harm_type_name, str, player_group)
set_window_mode
Set window.
Parameter
Variable | Type | Description |
---|---|---|
window_mode | string | Window type. |
ui:set_window_mode (window_mode)
set_graphics_quality
Set quality.
Parameter
Variable | Type | Description |
---|---|---|
quality_name | string | Quality. |
ui:set_graphics_quality (quality_name)
set_screen_resolution
Screen Resolution.
Parameters
Variable | Type | Description |
---|---|---|
x | float | X axis. |
y | float | Y axis. |
ui:set_screen_resolution (x, y)
get_widget_relative_x_coordinate
Get the X of the relative coordinates of the local control.
Return
Type | Description |
---|---|
float | X relative coordinate. |
ui:get_widget_relative_x_coordinate ()
get_widget_relative_y_coordinate
Get the Y of the relative coordinates of the local control.
Return
Type | Description |
---|---|
float | Y coordinate. |
ui:get_widget_relative_y_coordinate ()
get_widget_absolute_x_coordinate
Get the X of the absolute coordinates of the local control.
Return
Type | Description |
---|---|
float | X absolute coordinate. |
ui:get_widget_absolute_x_coordinate ()
get_widget_absolute_y_coordinate
Get the Y of the absolute coordinates of the local control.
Return
Type | Description |
---|---|
float | Y absolute coordinate. |
ui:get_widget_absolute_y_coordinate ()
get_widget_relative_rotation
Get the relative rotation of the local control.
Return
Type | Description |
---|---|
float | Relative rotation. |
ui:get_widget_relative_rotation ()
get_widget_absolute_rotation
Get the absolute rotation of the local control.
Return
Type | Description |
---|---|
float | Absolute rotation. |
ui:get_widget_absolute_rotation ()
get_widget_relative_scale_x_coordinate
Get the X of the relative zoom of the local control.
Return
Type | Description |
---|---|
float | X relative scaling. |
ui:get_widget_relative_scale_x_coordinate ()
get_widget_relative_scale_y_coordinate
Get the relative scaled Y of the native control.
Return
Type | Description |
---|---|
float | Y absolute scale. |
ui:get_widget_relative_scale_y_coordinate ()
get_widget_absolute_scale_x_coordinate
Get the X of the absolute scaling of the native control.
Return
Type | Description |
---|---|
float | X absolute scaling. |
ui:get_widget_absolute_scale_x_coordinate ()
get_widget_absolute_scale_y_coordinate
Get the Y of the local control's absolute scaling.
Return
Type | Description |
---|---|
float | Y absolute scale. |
ui:get_widget_absolute_scale_y_coordinate ()
convert_ui_widget_to_string
Interface controls are converted to strings.
Return
Type | Description |
---|---|
string | String. |
ui:convert_ui_widget_to_string ()
get_slider_current_value
Get the current value of the slider.
Return
Type | Description |
---|---|
float | Current value of the slider. |
ui:get_slider_current_value ()
get_ui_widget_name
Get interface control name.
Return
Type | Description |
---|---|
string | Control name. |
ui:get_ui_widget_name ()
get_child_widget_of_specified_name
Get the child control with the specified name.
Return
Type | Description |
---|---|
ui | Ui control. |
ui:get_child_widget_of_specified_name (name)
get_widget_width
Get the width of the control.
Return
Type | Description |
---|---|
float | Width of the control. |
ui:get_widget_width ()
get_widget_height
Get control height.
Return
Type | Description |
---|---|
float | Height of the control. |
ui:get_widget_height ()
get_screen_horizontal_resolution
Get the horizontal resolution of the screen.
Return
Type | Description |
---|---|
float | Horizontal resolution. |
ui:get_screen_horizontal_resolution ()
get_screen_vertical_resolution
Get the vertical resolution of the screen.
Return
Type | Description |
---|---|
float | Vertical resolution. |
ui:get_screen_vertical_resolution ()
get_parent_widget_of_ui_widget
Get the parent control of the interface control.
Return
Type | Description |
---|---|
ui | UI control. |
ui:get_parent_widget_of_ui_widget ()
get_input_field_content
Get the text content of the player input box.
Return
Type | Description |
---|---|
string | Text content. |
ui:get_input_field_content ()
get_ui_comp_visible
Get control visibility.
Return
Type | Description |
---|---|
boolean | Control visibility. |
ui:get_ui_comp_visible ()