Global

Members

GL :WebGLRenderingContext

Source:
Type:
  • WebGLRenderingContext

Methods

_createElement(node) → {UIElement}

创建预设元素的实例(私有)

Source:
Parameters:
Name Type Description
node Object

预设元素数据

Returns:
Type:
UIElement

_updateBubbleState(target)

更新事件冒泡状态(私有) 如果选中了UI元素 阻止事件传递到场景中

Source:
Parameters:
Name Type Description
target UIElement

(async) activate(pointer)

激活场景上下文

Source:
Parameters:
Name Type Description
pointer number

场景指针(0或1)

activate(element)

准备激活第一次添加到管理器中的元素

Source:
Parameters:
Name Type Description
element UIElement

元素实例

add(object)

添加对象到映射表中

Source:
Parameters:
Name Type Description
object Object

实体对象

add(presetId) → {UIElement}

创建预设元素的实例,并添加到跟元素

Source:
Parameters:
Name Type Description
presetId string

预设元素ID

Returns:
Type:
UIElement

addMember(actor)

添加玩家队伍成员

Source:
Parameters:
Name Type Description
actor GlobalActor

队伍成员

addPointerEventRoot(element)

添加指针事件根元素

Source:
Parameters:
Name Type Description
element UIElement

根元素

append(event)

添加已激活事件处理器

Source:
Parameters:
Name Type Description
event EventHandler

事件处理器

append(element)

添加元素到管理器中

Source:
Parameters:
Name Type Description
element UIElement

元素实例

autorun()

调用自动执行事件

Source:

bind(scene)

绑定场景上下文

Source:
Parameters:
Name Type Description
scene SceneContext | null

场景上下文对象

blur(event)

失去焦点事件

Source:
Parameters:
Name Type Description
event FocusEvent

焦点事件

buildPath(startX, startY, destX, destY, endIndex) → {Float64Array}

使用寻路后的数据建立路径

Source:
Parameters:
Name Type Description
startX number

起点位置X

startY number

起点位置Y

destX number

终点位置X

destY number

终点位置Y

endIndex number

终点顶点索引

Returns:
Type:
Float64Array

角色移动路径

calculateCoords(event)

计算坐标

Source:
Parameters:
Name Type Description
event PointerEvent

calculateSceneCoords()

计算场景坐标

Source:

call(id) → {EventHandler|undefined}

调用全局事件

Source:
Parameters:
Name Type Description
id string

全局事件文件ID

Returns:
Type:
EventHandler | undefined

callAutorunEvents()

调用自动执行事件

Source:

callSpecialEvent()

调用特殊事件

Source:

changeRelation(teamId1, teamId2, relation)

改变角色队伍的关系

Source:
Parameters:
Name Type Description
teamId1 string

队伍ID1

teamId2 string

队伍ID2

relation number

队伍1和队伍2的关系(0:敌对, 1:友好)

checkIfRemovedHover()

检查是否移除了hover元素

Source:

clearGlobalActors()

清除所有全局角色

Source:

compileEvents(data, eventPath) → {Object}

编译对象中的事件

Source:
Parameters:
Name Type Description
data Object

对象数据

eventPath string

事件路径

Returns:
Type:
Object

事件集合

continue()

继续场景活动

Source:

convertToScreenCoords(scenePos) → {Object}

将场景坐标转换为屏幕坐标

Source:
Parameters:
Name Type Description
scenePos Object

拥有场景坐标的对象

Returns:
Type:
Object

create(actorId, savedDataopt) → {GlobalActor|null}

创建全局角色

Source:
Parameters:
Name Type Attributes Description
actorId string

角色文件ID

savedData Object <optional>

角色存档数据

Returns:
Type:
GlobalActor | null

createAutotileMap()

创建自动图块模板数据映射表

Source:

createEasingMap()

创建过渡映射表

Source:

createElement(presetId) → {UIElement}

创建预设元素的实例

Source:
Parameters:
Name Type Description
presetId string

预设元素ID

Returns:
Type:
UIElement

createFollower() → {Object}

创建目标角色跟随器(返回更新器)

Source:
Returns:
Type:
Object

createMembers()

创建玩家队伍成员

Source:

createPath(startX, startY, destX, destY, passage, bypass) → {Float64Array}

创建路径(Lazy Theta*寻路算法)

Source:
Parameters:
Name Type Description
startX number

起点位置X

startY number

起点位置Y

destX number

终点位置X

destY number

终点位置Y

passage number

角色通行区域

bypass boolean

是否绕过角色

Returns:
Type:
Float64Array

角色移动路径

createPlayer()

创建玩家角色

Source:

createUnitPath(destX, destY) → {Float64Array}

创建单位移动路径

Source:
Parameters:
Name Type Description
destX number

终点位置X

destY number

终点位置Y

Returns:
Type:
Float64Array

角色移动路径

decodeClone(array, index) → {Object}

解码克隆数据

Source:
Parameters:
Name Type Description
array Uint8Array

字节码列表

index number

字节码索引

Returns:
Type:
Object

{结束位置, 克隆数量}

decodeTeamData(code, length) → {Uint8Array}

解码队伍数据

Source:
Parameters:
Name Type Description
code string

队伍数据编码

length number

队伍数量

Returns:
Type:
Uint8Array

队伍数据

decodeTerrains(scene, code, width, height) → {SceneTerrainArray}

解码地形

Source:
Parameters:
Name Type Description
scene SceneContext

场景上下文对象

code string

地形数据编码

width number

场景宽度

height number

场景高度

Returns:
Type:
SceneTerrainArray

场景地形数据列表

decodeTiles(code, width, height) → {Uint32Array}

解码图块

Source:
Parameters:
Name Type Description
code string

图块数据编码

width number

瓦片地图宽度

height number

瓦片地图高度

Returns:
Type:
Uint32Array

图块数据列表

delete(actorId)

删除全局角色

Source:
Parameters:
Name Type Description
actorId string

角色文件ID

(async) delete()

删除当前场景

Source:

deleteGameData(number) → {Promise.<undefined>}

删除游戏数据存档文件

Source:
Parameters:
Name Type Description
number string

存档编号

Returns:
Type:
Promise.<undefined>

disable(id)

禁用全局事件(立即)

Source:
Parameters:
Name Type Description
id string

全局事件文件ID

displayErrorMessage(event)

显示错误消息事件

Source:
Parameters:
Name Type Description
event ErrorEvent

错误事件

doubleclick(event)

鼠标双击事件

Source:
Parameters:
Name Type Description
event PointerEvent

指针事件

doubleclick()

鼠标双击事件

Source:

emit(type, …params)

发送输入事件

Source:
Parameters:
Name Type Attributes Description
type string

输入事件类型

params Array <repeatable>

传递参数

emit(type, priority, optionsopt)

发送全局事件

Source:
Parameters:
Name Type Attributes Default Description
type string

全局事件类型

priority boolean null

是不是优先事件

options Object <optional>

传递事件上下文属性

emit(type)

发送游戏事件

Source:
Parameters:
Name Type Description
type string

游戏事件类型

emit(type, parameter)

发送场景事件

Source:
Parameters:
Name Type Description
type string

场景事件类型

parameter any

场景事件传递参数

emitInputEvent(type, parameter)

发送场景输入事件

Source:
Parameters:
Name Type Description
type string

场景事件类型

parameter any

场景事件传递参数

enable(id)

启用全局事件(延迟)

Source:
Parameters:
Name Type Description
id string

全局事件文件ID

encodeTeamData(data) → {string}

编码队伍数据

Source:
Parameters:
Name Type Description
data Uint8Array

队伍数据列表

Returns:
Type:
string

队伍数据编码

encodeTerrains(terrains) → {string}

编码地形

Source:
Parameters:
Name Type Description
terrains Uint8Array

地形数组

Returns:
Type:
string

executeCallbacks()

执行时间缩放过渡结束回调

Source:

find(elements, x, y) → {UIElement|undefined}

查找目标元素(通过屏幕坐标)

Source:
Parameters:
Name Type Description
elements Array.<UIElement>

元素列表

x number

屏幕X

y number

屏幕Y

Returns:
Type:
UIElement | undefined

follow(target, easingIdopt, durationopt)

摄像机跟随目标角色

Source:
Parameters:
Name Type Attributes Description
target Actor

目标角色

easingId string <optional>

过渡曲线ID

duration number <optional>

持续时间(毫秒)

gamepadbuttonpress()

手柄按钮按下事件

Source:

gamepadbuttonrelease()

手柄按钮弹起事件

Source:

gamepadleftstickchange()

手柄左摇杆改变事件

Source:

gamepadrightstickchange()

手柄右摇杆改变事件

Source:

generate32bit() → {string}

生成32位GUID(8个字符)

Source:
Returns:
Type:
string

generate64bit() → {string}

生成64位GUID(16个字符)

Source:
Returns:
Type:
string

get(teamId) → {Object}

通过ID获取队伍

Source:
Parameters:
Name Type Description
teamId string

队伍ID

Returns:
Type:
Object

队伍

get(actorId) → {GlobalActor|undefined}

获取全局角色

Source:
Parameters:
Name Type Description
actorId string

角色文件ID

Returns:
Type:
GlobalActor | undefined

get() → {boolean}

获取事件冒泡状态

Source:
Returns:
Type:
boolean

false=停止传递事件

get(id) → {Array.<function()>}

获取指定ID的事件指令

Source:
Parameters:
Name Type Description
id string

事件ID

Returns:
Type:
Array.<function()>

get(descriptor) → {Promise.<(Object|Image|null)>}

获取文件

Source:
Parameters:
Name Type Description
descriptor Object

文件描述器

Returns:
Type:
Promise.<(Object|Image|null)>

get() → {SceneContext|null}

获取当前场景上下文

Source:
Returns:
Type:
SceneContext | null

get(entityId) → {Object|undefined}

从映射表中获取对象

Source:
Parameters:
Name Type Description
entityId string

实体对象ID

Returns:
Type:
Object | undefined

返回实体对象

get(key) → {EasingMap}

获取过渡曲线映射表

Source:
Parameters:
Name Type Description
key string

过渡曲线ID或键

Returns:
Type:
EasingMap

get(presetId) → {UIElement|undefined}

获取已经创建的元素实例(通过ID)

Source:
Parameters:
Name Type Description
presetId string

预设元素ID

Returns:
Type:
UIElement | undefined

get(key) → {any}

获取变量值

Source:
Parameters:
Name Type Description
key string

变量ID

Returns:
Type:
any

get(key) → {any}

获取变量值

Source:
Parameters:
Name Type Description
key string

变量ID

Returns:
Type:
any

get(attrId) → {Object|undefined}

获取属性

Source:
Parameters:
Name Type Description
attrId string

属性ID

Returns:
Type:
Object | undefined

get(stringId) → {Object|undefined}

获取字符串对象

Source:
Parameters:
Name Type Description
stringId string

字符串ID

Returns:
Type:
Object | undefined

getElementAtMouse() → {UIElement}

获取鼠标位置的元素

Source:
Returns:
Type:
UIElement

getGroup(groupId) → {Object|undefined}

获取属性群组

Source:
Parameters:
Name Type Description
groupId string

群组ID

Returns:
Type:
Object | undefined

getGroup(groupId) → {Object|undefined}

获取枚举字符串群组

Source:
Parameters:
Name Type Description
groupId string

群组ID

Returns:
Type:
Object | undefined

getItem(key) → {Promise.<any>}

获取数据内容

Source:
Parameters:
Name Type Description
key string

键(存档文件名)

Returns:
Type:
Promise.<any>

读取的数据

getKey(attrId) → {string}

获取属性键

Source:
Parameters:
Name Type Description
attrId string

属性ID

Returns:
Type:
string

getKeys() → {Promise.<Array.<string>>}

获取所有数据键(游戏存档文件名)

Source:
Returns:
Type:
Promise.<Array.<string>>

键列表

getName(attrId) → {string}

获取属性名称(未使用)

Source:
Parameters:
Name Type Description
attrId string

属性ID

Returns:
Type:
string

getName(stringId) → {string}

获取字符串名称(未使用)

Source:
Parameters:
Name Type Description
stringId string

字符串ID

Returns:
Type:
string

getParallaxAnchor(parallax) → {Object}

获取视差图锚点

Source:
Parameters:
Name Type Description
parallax SceneParallax | SceneTilemap

视差图或瓦片地图对象

Returns:
Type:
Object

getPathByGUID(guid) → {string}

获取文件路径(通过GUID)

Source:
Parameters:
Name Type Description
guid string

文件GUID

Returns:
Type:
string

文件路径或空字符串

getPointerEventRoot() → {UIElement}

获取指针事件根元素

Source:
Returns:
Type:
UIElement

getRelationByIndexes(teamIndex1, teamIndex2) → {number}

通过队伍索引获取队伍关系

Source:
Parameters:
Name Type Description
teamIndex1 number

队伍索引1

teamIndex2 number

队伍索引2

Returns:
Type:
number

队伍关系(0:敌对, 1:友好)

getValue(stringId) → {string}

获取字符串值

Source:
Parameters:
Name Type Description
stringId string

字符串ID

Returns:
Type:
string

initialize()

初始化队伍管理器

Source:

initialize()

初始化

Source:

initialize()

初始化音频管理器

Source:

initialize()

初始化摄像机

Source:

initialize()

初始化输入控制器

Source:

initialize()

初始化鼠标管理器

Source:

initialize() → {Promise}

初始化数据管理器

Source:
Returns:
Type:
Promise

initialize()

初始化全局事件管理器

Source:

initialize()

初始化插件管理器

Source:

(async) initialize()

初始化游戏

Source:

initialize()

初始化场景管理器

Source:

(async) initialize()

初始化舞台

Source:

initialize()

初始化游戏时间管理器

Source:

initialize()

初始化

Source:

initialize()

初始化界面管理器

Source:

initialize()

初始化错误报告器

Source:

initialize()

初始化全局变量

Source:

initialize()

初始化属性管理器

Source:

initialize()

初始化枚举管理器

Source:

isEnemy(teamId1, teamId2) → {boolean}

判断敌对关系

Source:
Parameters:
Name Type Description
teamId1 string

队伍ID1

teamId2 string

队伍ID2

Returns:
Type:
boolean

是否为敌对关系

isFriendly(teamId1, teamId2) → {boolean}

判断友好关系

Source:
Parameters:
Name Type Description
teamId1 string

队伍ID1

teamId2 string

队伍ID2

Returns:
Type:
boolean

是否为友好关系

isMacOS() → {boolean}

判断是不是Mac平台

Source:
Returns:
Type:
boolean

keydown(event)

键盘按下事件

Source:
Parameters:
Name Type Description
event KeyboardEvent

键盘事件

keydown()

键盘按下事件

Source:

keydownFilter(event)

按键过滤器

Source:
Parameters:
Name Type Description
event KeyboardEvent

键盘事件

keyup(event)

键盘弹起事件

Source:
Parameters:
Name Type Description
event KeyboardEvent

键盘事件

keyup()

键盘弹起事件

Source:

(async) load(id) → {Promise.<SceneContext>}

加载场景

Source:
Parameters:
Name Type Description
id string

场景文件ID

Returns:
Type:
Promise.<SceneContext>

loadData(party)

加载队伍角色数据

Source:
Parameters:
Name Type Description
party Object

loadData(team)

加载队伍关系数据

Source:
Parameters:
Name Type Description
team Object

loadData(actors)

加载全局角色列表数据

Source:
Parameters:
Name Type Description
actors Object

(async) loadData(camera)

加载摄像机数据

Source:
Parameters:
Name Type Description
camera Object

loadData(data)

加载场景数据

Source:
Parameters:
Name Type Description
data Object

loadData(variables)

加载独立变量数据(无法删除旧存档中的无效数据)

Source:
Parameters:
Name Type Description
variables Object

保存的独立变量数据

loadData(groupIndex, variables)

加载全局变量数据

Source:
Parameters:
Name Type Description
groupIndex number

变量分组索引(0:常规, 1:共享)

variables Object

保存的全局变量数据

loadFile(filename) → {Promise.<object>}

加载数据文件

Source:
Parameters:
Name Type Description
filename string

/data目录下的文件名

Returns:
Type:
Promise.<object>

(async) loadGameData(number) → {Promise.<undefined>}

从文件中加载游戏数据

Source:
Parameters:
Name Type Description
number string

存档编号

Returns:
Type:
Promise.<undefined>

(async) loadGlobalData() → {Promise.<undefined>}

从文件中加载全局数据

Source:
Returns:
Type:
Promise.<undefined>

loadMeta() → {Promise}

加载文件的元数据清单

Source:
Returns:
Type:
Promise

(async) loadObjects()

加载各种对象数据文件

Source:

loadPresets()

加载预设元素

Source:

(async) loadSaveMeta() → {Promise.<Array.<Object>>}

加载存档元数据列表

Source:
Returns:
Type:
Promise.<Array.<Object>>

loadScene(id) → {Promise.<Object>}

加载场景数据

Source:
Parameters:
Name Type Description
id string

场景文件ID

Returns:
Type:
Promise.<Object>

(async) loadScripts()

加载脚本文件(动态导入模块)

Source:

loadUI(uiId) → {Array.<UIElement>}

加载界面中的所有元素

Source:
Parameters:
Name Type Description
uiId string

界面文件ID

Returns:
Type:
Array.<UIElement>

mousedown()

鼠标按下事件

Source:

mousedownLB()

鼠标左键按下事件

Source:

mousedownRB()

鼠标右键按下事件

Source:

mouseleave()

鼠标离开事件

Source:

mousemove()

鼠标移动事件

Source:

mouseup()

鼠标弹起事件

Source:

mouseupLB()

鼠标左键弹起事件

Source:

mouseupRB()

鼠标右键弹起事件

Source:

moveTo(x, y, easingIdopt, durationopt)

移动摄像机到指定位置

Source:
Parameters:
Name Type Attributes Description
x number

场景X

y number

场景Y

easingId string <optional>

过渡曲线ID

duration number <optional>

持续时间(毫秒)

off(type, listener)

移除输入事件侦听器

Source:
Parameters:
Name Type Description
type string

输入事件类型

listener function

回调函数

off(type, listener)

移除场景事件侦听器(未使用)

Source:
Parameters:
Name Type Description
type string

场景事件类型

listener function

回调函数

off(type, listener)

移除界面事件侦听器(未使用)

Source:
Parameters:
Name Type Description
type string

界面事件类型

listener function

回调函数

on(type, listener, priorityopt)

添加输入事件侦听器

Source:
Parameters:
Name Type Attributes Default Description
type string

输入事件类型

listener function

回调函数

priority boolean <optional>
false

是否将该事件设为最高优先级

on(type, listener)

添加游戏事件侦听器

Source:
Parameters:
Name Type Description
type string

游戏事件类型

listener function

回调函数

on(type, listener, priorityopt)

添加场景事件侦听器

Source:
Parameters:
Name Type Attributes Default Description
type string

场景事件类型

listener function

回调函数

priority boolean <optional>
false

是否将该事件设为最高优先级

on(type, listener, priorityopt)

添加界面事件侦听器

Source:
Parameters:
Name Type Attributes Default Description
type string

界面事件类型

listener function

回调函数

priority boolean <optional>
false

是否将该事件设为最高优先级

onTransitionEnd(callback)

设置时间缩放过渡结束回调

Source:
Parameters:
Name Type Description
callback function

回调函数

(async) open() → {Promise.<IDBObjectStore>}

打开数据库

Source:
Returns:
Type:
Promise.<IDBObjectStore>

parseCSSColor(hex) → {string}

解析十六进制字符串返回CSS颜色

Source:
Parameters:
Name Type Description
hex string

十六进制颜色

Returns:
Type:
string

parseDateTimestamp(timestamp, format) → {string}

解析日期时间戳

Source:
Parameters:
Name Type Description
timestamp number

时间戳

format string

日期格式

Returns:
Type:
string

parseFloatArray(hex) → {Float64Array}

解析十六进制字符串返回浮点型数组颜色

Source:
Parameters:
Name Type Description
hex string

十六进制颜色

Returns:
Type:
Float64Array

parseFloatArrayTag(hex) → {Float64Array}

解析颜色标签字符串返回浮点型数组颜色

Source:
Parameters:
Name Type Description
hex string

十六进制颜色

Returns:
Type:
Float64Array

parseGUID(meta) → {string}

从元数据中解析文件GUID

Source:
Parameters:
Name Type Description
meta Object

文件的元数据

Returns:
Type:
string

文件GUID

parseInt(hex) → {number}

解析十六进制字符串返回整数颜色(32位整数)

Source:
Parameters:
Name Type Description
hex string

十六进制颜色

Returns:
Type:
number

parseIntArray(hex) → {Uint8Array}

解析十六进制字符串返回整型数组颜色

Source:
Parameters:
Name Type Description
hex string

十六进制颜色

Returns:
Type:
Uint8Array

pause()

暂停场景活动

Source:

pointerdown(event)

指针按下事件

Source:
Parameters:
Name Type Description
event PointerEvent

指针事件

pointerenter(event)

指针进入事件

Source:
Parameters:
Name Type Description
event PointerEvent

指针事件

pointerleave(event)

指针离开事件

Source:
Parameters:
Name Type Description
event PointerEvent

指针事件

pointermove(event)

指针移动事件

Source:
Parameters:
Name Type Description
event PointerEvent

指针事件

pointerup(event)

指针弹起事件

Source:
Parameters:
Name Type Description
event PointerEvent

指针事件

pop()

弹出事件冒泡状态

Source:

(async) precompile()

预编译对象数据

Source:

precompileActors()

预编译角色数据

Source:

precompileAnimations()

预编译动画数据

Source:

precompileEquipments()

预编译装备数据

Source:

precompileItems()

预编译物品数据

Source:

precompileSkills()

预编译技能数据

Source:

precompileStates()

预编译状态数据

Source:

precompileTriggers()

预编译触发器数据

Source:

preventInput()

阻止场景输入

Source:

push(bubble)

推入事件冒泡状态

Source:
Parameters:
Name Type Description
bubble boolean

冒泡状态

push(fn)

推送回调函数,稍后执行

Source:
Parameters:
Name Type Description
fn function

回调函数

remapScripts()

重新映射脚本路径(TS->JS)

Source:

remove(object)

从映射表中移除对象

Source:
Parameters:
Name Type Description
object Object

实体对象

remove(element)

从管理器中移除元素

Source:
Parameters:
Name Type Description
element UIElement

元素实例

removeItem(key) → {Promise.<undefined>}

移除数据内容

Source:
Parameters:
Name Type Description
key string

键(存档文件名)

Returns:
Type:
Promise.<undefined>

removeLatestPointerEventRoot()

移除最新的焦点

Source:

removeMember(actor)

移除玩家队伍成员

Source:
Parameters:
Name Type Description
actor GlobalActor

队伍成员

removePointerEventRoot(element)

移除指针事件根元素

Source:
Parameters:
Name Type Description
element UIElement

根元素

render()

开始渲染离屏画面

Source:

render()

结束渲染离屏画面

Source:

render()

渲染场景色调

Source:

render()

渲染场景

Source:

render()

渲染元素

Source:

renderLoadingProgress()

渲染同步加载进度

Source:

reset()

重置队伍角色

Source:

reset()

重置全局角色

Source:

reset()

重置所有音频播放器

Source:

reset()

重置摄像机

Source:

reset()

重置回调堆栈

Source:

reset()

重置全局事件的开关状态

Source:

reset()

重置色调

Source:

reset()

重置游戏

Source:

reset()

重置所有场景

Source:

reset()

重置游戏时间管理器

Source:

reset()

重置界面,销毁所有元素

Source:

reset()

重置变量值

Source:

reset()

重置变量值

Source:

resetPointerEventRoots()

重置指针事件根元素

Source:

resize()

重新调整位置

Source:

resize()

重新调整大小事件

Source:

resize()

重新调整大小事件

Source:

restoreInput()

恢复场景输入

Source:

rotateAndScaleCanvas(resolution)

旋转并缩放画布

Source:
Parameters:
Name Type Description
resolution Object

分辨率数据对象

route()

获取文件路径(客户端专用)

Source:

saveData()

保存队伍角色数据

Source:

saveData()

保存队伍关系数据

Source:

saveData()

保存全局角色列表数据

Source:

saveData()

保存摄像机数据

Source:

saveData()

保存场景数据

Source:

saveData()

保存独立变量数据

Source:

saveData(groupIndex) → {Object}

保存全局变量数据

Source:
Parameters:
Name Type Description
groupIndex number

变量分组索引(0:常规, 1:共享)

Returns:
Type:
Object

saveGameData(number, meta) → {Promise.<undefined>}

保存游戏数据到文件

Source:
Parameters:
Name Type Description
number string

存档编号

meta Object

存档元数据(时间、地点、截图等附加数据)

Returns:
Type:
Promise.<undefined>

saveGlobalData() → {Promise.<undefined>}

保存全局数据到文件

Source:
Returns:
Type:
Promise.<undefined>

scaleCanvas(resolution)

缩放画布

Source:
Parameters:
Name Type Description
resolution Object

分辨率数据对象

set(tint, easingId, duration)

设置场景色调: 红[-255, 255] 绿[-255, 255] 蓝[-255, 255] 灰[0, 255]

Source:
Parameters:
Name Type Description
tint Array.<number>

色调数组

easingId string

过渡曲线ID

duration number

持续时间(毫秒)

set(scene) → {SceneContext|null}

设置当前场景上下文

Source:
Parameters:
Name Type Description
scene SceneContext | null

场景上下文对象

Returns:
Type:
SceneContext | null

set(key, value)

设置变量值

Source:
Parameters:
Name Type Description
key string

变量ID

value any

变量值

set(key, value)

设置变量值

Source:
Parameters:
Name Type Description
key string

变量ID

value any

变量值

setBypass(bypass)

设置绕开角色开关

Source:
Parameters:
Name Type Description
bypass boolean

setItem(key, value) → {Promise.<undefined>}

设置数据内容

Source:
Parameters:
Name Type Description
key string

键(存档文件名)

value any

写入的数据

Returns:
Type:
Promise.<undefined>

setPlayer(actor)

设置玩家角色

Source:
Parameters:
Name Type Description
actor GlobalActor

玩家角色

setResolution(width, height, sceneScale, uiScale)

设置分辨率

Source:
Parameters:
Name Type Description
width number

分辨率宽度

height number

分辨率高度

sceneScale number

场景缩放系数

uiScale number

界面缩放系数

setTimeScale(timeScale, easingId, duration)

设置增量时间缩放比例

Source:
Parameters:
Name Type Description
timeScale number

增量时间缩放比例

easingId string

过渡曲线ID

duration number

持续时间(毫秒)

setToHighestPriority(id)

设置全局事件为最高优先级

Source:
Parameters:
Name Type Description
id string

全局事件文件ID

setZoomFactor(zoom, easingIdopt, durationopt)

设置摄像机缩放系数

Source:
Parameters:
Name Type Attributes Description
zoom number

缩放系数[1-8]

easingId string <optional>

过渡曲线ID

duration number <optional>

持续时间(毫秒)

shake(modeopt, poweropt, speedopt, easingIdopt, durationopt)

震动屏幕

Source:
Parameters:
Name Type Attributes Default Description
mode string <optional>
random

震动模式

power number <optional>
5

强度

speed number <optional>
5

速度

easingId string <optional>

过渡曲线ID

duration number <optional>
1000

持续时间(ms)

shareInventory()

共享玩家角色库存

Source:

simulateButton(button)

模拟鼠标按键

Source:
Parameters:
Name Type Description
button number

simulateKey(keycode)

模拟键盘按键

Source:
Parameters:
Name Type Description
keycode string

start()

开始游戏

Source:

stop()

停止事件冒泡

Source:

switchGameInfoDisplay()

开关游戏信息显示面板

Source:

testConditions(node) → {boolean}

测试场景对象初始化条件

Source:
Parameters:
Name Type Description
node Object

场景对象预设数据

Returns:
Type:
boolean

unfollow()

解除摄像机跟随目标

Source:

unpack(items)

解包变量数据

Source:
Parameters:
Name Type Description
items Array.<Object>

变量数据列表

unpack(items, groupKeys)

解包属性数据

Source:
Parameters:
Name Type Description
items Array.<Object>

属性数据列表

groupKeys Array.<string>

群组ID的栈列表

unpack(items, groupKeys)

解包枚举字符串和群组的数据

Source:
Parameters:
Name Type Description
items Array.<Object>

枚举字符串列表

groupKeys Array.<string>

群组ID的栈列表

unpackTeamData(keys, code) → {Object}

解包角色队伍数据

Source:
Parameters:
Name Type Description
keys Array.<string>

队伍的ID列表

code string

队伍的关系代码

Returns:
Type:
Object

update(deltaTime)

更新摄像机的位置以及相关参数

Source:
Parameters:
Name Type Description
deltaTime number

增量时间(毫秒)

update()

更新输入状态

Source:

update()

更新鼠标的场景坐标

Source:

update()

执行回调函数

Source:

update(deltaTime)

更新管理器中的已激活事件处理器

Source:
Parameters:
Name Type Description
deltaTime number

增量时间(毫秒)

update()

更新场景色调

Source:

update(timestamp)

更新游戏循环

Source:
Parameters:
Name Type Description
timestamp number

增量时间(毫秒)

update(deltaTime)

更新场景

Source:
Parameters:
Name Type Description
deltaTime number

增量时间(毫秒)

update(timestamp)

更新当前帧的时间相关参数

Source:
Parameters:
Name Type Description
timestamp number

增量时间(毫秒)

update()

更新元素

Source:

update()

更新已连接的元素

Source:

update()

擦除数据

Source:

updateLoadingProgress() → {boolean}

更新同步加载进度

Source:
Returns:
Type:
boolean

加载是否完成

wheel(event)

鼠标滚轮事件

Source:
Parameters:
Name Type Description
event WheelEvent

滚轮事件

wheel()

鼠标滚轮事件

Source:

xhr($) → {Promise}

使用XHR加载文件

Source:
Parameters:
Name Type Description
$ Object
$.path string

文件路径

$.sync boolean

同步开关

$.type string

类型

Returns:
Type:
Promise

Type Definitions

Module

Properties:
Name Type Attributes Description
update function <optional>

更新模块

render function <optional>

渲染模块

Source: