跳到主要内容

clampCamera 限制摄像机边界

clampCamera

类型: MethodDeclaration

所属类: CommandFunctionList

定义位置: command.ts

描述

限制摄像机边界

参数

参数名类型描述默认值
\{left, top, right, bottom\}`{
left: number | VariableGetter
top: number | VariableGetter
right: number | VariableGetter
bottom: number | VariableGetter
}`--

返回值

类型: CommandFunction

源代码

位置: 第 7258 行

protected clampCamera({left, top, right, bottom}: {
left: number | VariableGetter
top: number | VariableGetter
right: number | VariableGetter
bottom: number | VariableGetter
}): CommandFunction {
const getLeft = Command.compileNumber(left, 0, -1000, 1000)
const getTop = Command.compileNumber(top, 0, -1000, 1000)
const getRight = Command.compileNumber(right, 0, -1000, 1000)
const getBottom = Command.compileNumber(bottom, 0, -1000, 1000)
return () => {
Camera.clamp(getLeft(), getTop(), getRight(), getBottom())
return true
}
}

文档生成时间:2025/7/7 12:07:06