====== Customui Class ======
Class For Customui Interface
[[developer_center:developer_editor:script|Return To Previous Page]]
------
==== How to Write Event =====
ScriptSupportEvent:registerEvent([[EventName]],callbackFunctionName)
==== Example ====
local function Button_Click (event)
local playerid,ElementID = e.eventobjid,e.uielement
end
ScriptSupportEvent:registerEvent([[UI.Button.Click]],Button_Click)
===== Eventlist =====
^ EventName ^ Parameters ^ Descriptionn ^
| UI.Button.Click | eventobjid,CustomUI,uielement | Any UI buttons release |
| UI.Button.TouchBegin | eventobjid,CustomUI,uielement | Any UI buttons start to press |
| UI.Hide | eventobjid,CustomUI | Any UI closed |
| UI.LostFocus | eventobjid,CustomUI,uielement,content | Any input area loses focus |
| UI.Show | eventobjid,CustomUI | Any UI opened |
===== Api list =====
==== Global Call ====
This API can be called from a global script.
^ Class:apiName ^ Return ^ Descriptionn ^
| [[script:ui_event:openUIView|Player:openUIView]] | ErrorCode.OK | Open the specified UI for the player. |
|[[script:ui_event:hideUIView|Player:hideUIView]] | ErrorCode.OK | Hide the UI for the player. |
==== Local Call ====
This API can be called from a local script within the CustomUI page.(All APIs below need to call from customui script, it won't work on global script.)
^ Class:apiName ^ Return ^ Descriptionn ^
|[[script:ui_event:setText|Customui:setText]] | ErrorCode.OK | Set the display content of the player's text component |
|[[script:ui_event:setTexture|Customui:setTexture]] | ErrorCode.OK | Sets the pattern of the player's image component |
|[[script:ui_event:setSize|Customui:setSize]] | ErrorCode.OK | Sets the size of the player's component |
|[[script:ui_event:setFontSize|Customui:setFontSize]] | ErrorCode.OK | Sets the font size of the player's text component |
|[[script:ui_event:setColor|Customui:setColor]] | ErrorCode.OK | Set the player's component color |
|[[script:ui_event:showElement|Customui:showElement]] | ErrorCode.OK | Show component to player |
|[[script:ui_event:hideElement|Customui:hideElement]] | ErrorCode.OK | Hide component to player |
|[[script:ui_event:rotateElement|Customui:rotateElement]] | ErrorCode.OK | Rotate the component against the player |
|[[script:ui_event:setState|Customui:setState]] | ErrorCode.OK | Toggle the player's page status |
|[[script:ui_event:setAlpha|Customui:setAlpha]] | ErrorCode.OK | Set component opacity |
|[[script:ui_event:setPosition|Customui:setPosition]] | ErrorCode.OK | Set component position |
|[[script:ui_event:getItemIcon|Customui:getItemIcon]] | ErrorCode.OK, iconid:number(props) | Get the iconID of the prop type icon |
|[[script:ui_event:getMonsterObjIcon|Customui:getMonsterObjIcon]] | ErrorCode.OK, iconid:Creature iconID | Get creature icon iconID|
|[[script:ui_event:getMonsterIcon|Customui:getMonsterIcon]] | ErrorCode.OK, iconid:Creature type iconID | Get the creature type iconID |
|[[script:ui_event:getStatusIcon|Customui:getStatusIcon]] | ErrorCode.OK, iconid:Buff iconID | Get the status type iconID |
|[[script:ui_event:getBlockIcon|Customui:getBlockIcon]] | ErrorCode.OK, iconid:Block iconID | Get the block type iconID |
|[[script:ui_event:getRoleIcon|Customui:getRoleIcon]] | ErrorCode.OK, iconid:Role iconID | Get the character type iconID |
|[[script:ui_event:getShuctIcon|Customui:getShuctIcon]] | ErrorCode.OK, iconid:Role iconID | Get the shortcut bar(ix) prop iconID |
:!: NEW APIs exist in Version 1.5.5 or above :!:
^ Class:apiName(parameters) ^ Return ^ Descriptionn ^
|[[script:ui_event:SmoothMoveTo|Customui:SmoothMoveTo ]] | ErrorCode.OK | Smoothly move the component to the specified position |
|[[script:ui_event:getShuctIcon|Customui:SmoothMoveBy]] | ErrorCode.OK | Smooth movement of components relative to distance |
|[[script:ui_event:SmoothScaleTo|Customui:SmoothScaleTo]] | ErrorCode.OK | Smoothly change the component to the specified width and height |
|[[script:ui_event:SmoothScaleBy|Customui:SmoothScaleBy]] | ErrorCode.OK | Smoothly change the relative width and height of the component |
|[[script:ui_event:SmoothRotateTo|Customui:SmoothRotateTo]] | ErrorCode.OK | Smoothly rotate the component to a specified angle |
|[[script:ui_event:SmoothRotateBy|Customui:SmoothRotateBy]] | ErrorCode.OK | Smooth rotation of components to relative angles |
|[[script:ui_event:PlayElementAnim|Customui:PlayElementAnim]] | ErrorCode.OK | Start component animation(animid) |
|[[script:ui_event:StopAnim|Customui:StopAnim]]| ErrorCode.OK | Stop animation of the component |