# 自定义UI管理接口 Customui
具体函数名及描述如下:
序号 | 函数名 | 函数描述 |
---|---|---|
1 | openUIView(...) | 打开一个UI界面(注意:继承自player对象) |
2 | hideUIView(...) | 隐藏一个UI界面(注意:继承自player对象) |
1 | setText(...) | 设置文本元件内容(只在UI局部脚本有效) |
2 | setTexture(...) | 设置元件图案纹理(只在UI局部脚本有效) |
3 | setSize(...) | 设置元件大小(只在UI局部脚本有效) |
4 | setFontSize(...) | 设置文本元件字体大小(只在UI局部脚本有效) |
5 | setColor(...) | 设置文本元件颜色(只在UI局部脚本有效) |
6 | showElement(...) | 显示元件(只在UI局部脚本有效) |
7 | hideElement(...) | 隐藏元件(只在UI局部脚本有效) |
8 | rotateElement(...) | 旋转元件(只在UI局部脚本有效) |
9 | setAlpha(...) | 设置透明度(只在UI局部脚本有效)1.9+ |
10 | setState(...) | 设置状态(只在UI局部脚本有效)1.9+ |
11 | setPosition(...) | 设置位置(只在UI局部脚本有效)1.9+ |
12 | getItemIcon(...) | 获取道具类型图标iconID(只在UI局部脚本有效)2.0+ |
13 | getMonsterObjIcon(...) | 获取生物图标iconID(只在UI局部脚本有效)2.0+ |
14 | getMonsterIcon(...) | 获取生物类型图标iconID(只在UI局部脚本有效)2.0+ |
15 | getStatusIcon(...) | 获取状态类型图标iconID(只在UI局部脚本有效)2.0+ |
16 | getBlockIcon(...) | 获取方块类型图标iconID(只在UI局部脚本有效)2.0+ |
17 | getRoleIcon(...) | 获取角色类型图标iconID2.0+ |
18 | getShuctIcon(...) | 获取玩家快捷栏道具图标iconID2.0+ |
# openUIView 1.8+
local result = Player:openUIView(objid, uiname)
# hideUIView 1.8+
local result = Player:hideUIView(objid, uiname)
# setText
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置文本元件内容
- 具体使用案例如下:
local result = Customui:setText(playerid, uiid, elementid, text)
# setTexture
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置文本元件图案纹理
- 具体使用案例如下:
local result = Customui:setTexture(playerid, uiid, elementid, url)
# setSize
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置元件大小
- 具体使用案例如下:
local result = Customui:setSize(playerid, uiid, elementid, width, height)
# setFontSize
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置文本元件字体大小
- 具体使用案例如下:
local result = Customui:setFontSize(playerid, uiid, elementid, size)
# setColor
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置文本元件颜色
- 具体使用案例如下:
local result = Customui:setColor(playerid, uiid, elementid, color)
# showElement
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:显示元件
- 具体使用案例如下:
local result = Customui:showElement(playerid, uiid, elementid)
# hideElement
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:隐藏元件
- 具体使用案例如下:
local result = Customui:hideElement(playerid, uiid, elementid)
# rotateElement
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:旋转元件
- 具体使用案例如下:
local result = Customui:rotateElement(playerid, uiid, elementid, rotate)
# setAlpha
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置透明度
- 具体使用案例如下:
local result = Customui:setAlpha(playerid, uiid, elementid, alpha)
# setState
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置状态
- 具体使用案例如下:
local result = Customui:setState(playerid, uiid, elementid, state)
# setPosition
- 参数及类型:
- 返回值及类型:
- ErrorCode.OK
- 该方法的主要作用:设置位置
- 具体使用案例如下:
local result = Customui:setPosition(playerid, uiid, elementid, x,y)
# getItemIcon
- 参数及类型:
- itemid:
number
道具类型ID
- itemid:
- 返回值及类型:
- 该方法的主要作用:获取道具类型图标iconID
- 具体使用案例如下:
local result,iconid = Customui:getItemIcon(itemid)
# getMonsterObjIcon
local result,iconid = Customui:getMonsterObjIcon(objid)
# getMonsterIcon
- 参数及类型:
- actorid:
number
生物类型ID
- actorid:
- 返回值及类型:
- 该方法的主要作用:获取生物类型图标iconID
- 具体使用案例如下:
local result,iconid = Customui:getMonsterIcon(actorid)
# getStatusIcon
- 参数及类型:
- buffid:
number
状态类型ID
- buffid:
- 返回值及类型:
- 该方法的主要作用:获取状态类型图标iconID
- 具体使用案例如下:
local result,iconid = Customui:getStatusIcon(buffid)
# getBlockIcon
- 参数及类型:
- blockid:
number
方块类型ID
- blockid:
- 返回值及类型:
- 该方法的主要作用:获取方块类型图标iconID
- 具体使用案例如下:
local result,iconid = Customui:getBlockIcon(blockid)
# getRoleIcon
- 参数及类型:
- playerid:
number
玩家ID
- playerid:
- 返回值及类型:
- 该方法的主要作用:获取角色类型图标iconID
- 具体使用案例如下:
local result,iconid = Customui:getRoleIcon(playerid)
# getShuctIcon
- 参数及类型:
- 返回值及类型:
- 该方法的主要作用:获取玩家快捷栏道具图标iconID
- 具体使用案例如下:
local result,iconid = Customui:getShuctIcon(playerid,ix)