ZepetoinputControl
38 分
类型 说明 playeractions /#playeractions 处理移动、跳跃、二段跳等玩家专属操作。 cameraactions /#cameraactions 管理 zepeto world 内与摄像机相关的输入操作。 uiactions /#uiactions 处理与 ui 相关的各类输入操作。 iplayeractions /#iplayeractions 玩家操作的接口。 icameraactions /#icameraactions 摄像机操作的接口。 iuiactions /#iuiactions ui 操作的接口。 playeractions class 处理移动、跳跃、二段跳等玩家专属操作。 属性 名称 类型 说明 move inputaction 获取玩家移动对应的输入操作。 jump inputaction 获取玩家跳跃对应的输入操作。 doublejump inputaction 获取玩家二段跳对应的输入操作。 enabled boolean 表示玩家输入操作当前的启用状态。 方法 get get() → inputactionmap 获取与玩家操作关联的 inputactionmap 。 返回值: inputactionmap — 玩家操作的 inputactionmap 。 enable enable() → void 启用玩家的 action map,使玩家输入操作可用。 disable disable() → void 禁用玩家的 action map,使玩家输入操作不可用。 setcallbacks setcallbacks(instance iplayeractions) → void 将 instance 中的回调方法关联到对应的玩家操作。 参数 类型 说明 instance iplayeractions /#iplayeractions 实现了 iplayeractions 接口的对象。 cameraactions class 管理 zepeto world 内与摄像机相关的输入操作。 属性 名称 类型 说明 scroll inputaction 返回摄像机滚动对应的输入操作。 primarytouchposition inputaction 返回用于获取第一触点位置的输入操作。 primarytouchcontact inputaction 返回用于检测第一触点接触状态的输入操作。 secondarytouchposition inputaction 返回用于获取第二触点位置的输入操作。 secondarytouchcontact inputaction 返回用于检测第二触点接触状态的输入操作。 tertiarytouchposition inputaction 返回用于获取第三触点位置的输入操作。 tertiarytouchcontact inputaction 返回用于检测第三触点接触状态的输入操作。 enabled boolean 表示摄像机 action map 内的输入操作当前是否已启用。 方法 get get() → inputactionmap 从 zepetoinputcontrol 中获取与摄像机操作关联的 inputactionmap 。 返回值: inputactionmap — 返回一个 inputactionmap 对象,即摄像机相关输入操作的集合。 enable enable() → void 启用摄像机 action map 内的所有输入操作。 disable disable() → void 禁用摄像机 action map 内的所有输入操作。 setcallbacks setcallbacks(instance icameraactions) → void 设置摄像机操作的回调接口,以便在外部实现操作处理程序。 参数 类型 说明 instance icameraactions /#icameraactions 实现了 icameraactions 接口的对象。 uiactions class 处理与 ui 相关的各类输入操作。 属性 名称 类型 说明 navigate inputaction 该操作用于处理菜单、列表等 ui 元素之间的导航,通常使用方向键、摇杆操作、滑动手势等方向输入。 submit inputaction 表示确认或选中当前高亮 ui 元素的操作,相当于“enter”或“ok”命令。 cancel inputaction 该操作对应取消或“返回”命令,可让用户返回上一级菜单或关闭当前 ui 窗口。 point inputaction 处理 ui 中的指向机制,类似于移动鼠标光标或触摸屏上的手指接触点。 click inputaction 表示点击 ui 元素的操作,相当于鼠标点击或屏幕轻触。 scrollwheel inputaction 该操作用于获取滚动输入,例如来自鼠标滚轮或触控板手势的输入。 middleclick inputaction 表示按下鼠标中键的操作。 rightclick inputaction 对应鼠标右键点击操作,常用于打开上下文菜单或执行次级操作。 trackeddeviceposition inputaction 获取被追踪设备的位置数据,例如 vr 控制器或动作追踪设备。 trackeddeviceorientation inputaction 追踪设备的朝向,通常用于 vr 或 ar 场景中检测设备所指向或面向的方向。 enabled boolean 表示 ui 操作当前是否处于激活状态并可响应输入。 方法 get get() → inputactionmap 返回与 ui 操作关联的 inputactionmap 。 返回值: inputactionmap — 返回的 inputactionmap 包含 zepetoinputcontrol 类中为 ui 交互定义的所有输入操作。 enable enable() → void 启用 ui 输入操作,使其可响应用户输入。 disable disable() → void 禁用 ui 输入操作,使其不再响应用户输入。 setcallbacks setcallbacks(instance iuiactions) → void 注册 ui 操作的回调方法。该方法按照 instance 所实现的 iuiactions 接口中的定义,将各操作与对应的事件处理程序关联起来。 参数 类型 说明 instance iuiactions /#iuiactions 实现了 iuiactions 接口的对象。 iplayeractions interface 玩家操作的接口。 方法 onmove onmove(context callbackcontext) → void 移动时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onjump onjump(context callbackcontext) → void 跳跃时调用。 参数 类型 说明 context callbackcontext 回调上下文。 ondoublejump ondoublejump(context callbackcontext) → void 二段跳时调用。 参数 类型 说明 context callbackcontext 回调上下文。 icameraactions interface 摄像机操作的接口。 方法 onscroll onscroll(context callbackcontext) → void 滚动时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onprimarytouchposition onprimarytouchposition(context callbackcontext) → void 第一触点位置变化时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onprimarytouchcontact onprimarytouchcontact(context callbackcontext) → void 第一触点发生接触时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onsecondarytouchposition onsecondarytouchposition(context callbackcontext) → void 滚动时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onsecondarytouchcontact onsecondarytouchcontact(context callbackcontext) → void 第二触点发生接触时调用。 参数 类型 说明 context callbackcontext 回调上下文。 ontertiarytouchposition ontertiarytouchposition(context callbackcontext) → void 第三触点位置变化时调用。 参数 类型 说明 context callbackcontext 回调上下文。 ontertiarytouchcontact ontertiarytouchcontact(context callbackcontext) → void 第三触点发生接触时调用。 参数 类型 说明 context callbackcontext 回调上下文。 iuiactions interface ui 操作的接口。 方法 onnavigate onnavigate(context callbackcontext) → void 导航时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onsubmit onsubmit(context callbackcontext) → void 确认时调用。 参数 类型 说明 context callbackcontext 回调上下文。 oncancel oncancel(context callbackcontext) → void 取消时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onpoint onpoint(context callbackcontext) → void 指向时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onclick onclick(context callbackcontext) → void 点击时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onscrollwheel onscrollwheel(context callbackcontext) → void 使用滚轮时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onmiddleclick onmiddleclick(context callbackcontext) → void 点击中键时调用。 参数 类型 说明 context callbackcontext 回调上下文。 onrightclick onrightclick(context callbackcontext) → void 点击右键时调用。 参数 类型 说明 context callbackcontext 回调上下文。 ontrackeddeviceposition ontrackeddeviceposition(context callbackcontext) → void 被追踪设备位置变化时调用。 参数 类型 说明 context callbackcontext 回调上下文。 ontrackeddeviceorientation ontrackeddeviceorientation(context callbackcontext) → void 被追踪设备朝向变化时调用。 参数 类型 说明 context callbackcontext 回调上下文。
