Skip to content

Camera

class Camera
Example
on_npc_option(Assets.Npc.hans.id, "Talk-to") { player ->
val camera = player.camera
camera.moveTo(player.tile4, height = 600, speed = 4)
camera.lookAt(target.tile4, height = 200, speed = 4)
}
on_world_click { player -> player.camera.reset() }
fun moveTo(
to: Tile4,
height: Int,
speed: Int,
acceleration: Int = speed
)
fun moveTo(
to: Tile4,
height: Int,
speed: Int,
acceleration: Int = speed,
relativeHeight: Boolean
)
fun lookAt(
at: Tile4,
height: Int,
speed: Int,
acceleration: Int = speed
)
fun lookAt(
at: Tile4,
height: Int,
speed: Int,
acceleration: Int = speed,
relativeHeight: Boolean
)
fun lookAt(
target: Entity,
cycles: Int,
easing: CameraEaseFunction = CameraEaseFunction.LINEAR,
follow: Boolean = false
)
fun lookAtOver(
at: Tile4,
height: Int,
cycles: Int,
easing: CameraEaseFunction = CameraEaseFunction.LINEAR,
track: Boolean = false,
relativeHeight: Boolean = false
)
fun rotateTo(
yaw: Int,
pitch: Int,
cycles: Int = 0,
easing: CameraEaseFunction = CameraEaseFunction.LINEAR
)
fun rotateBy(
yaw: Int,
pitch: Int,
cycles: Int = 0,
easing: CameraEaseFunction = CameraEaseFunction.LINEAR
)
fun atOnce(block: Camera.() -> Unit)
fun unlockPitch(unlocked: Boolean = true)
fun shake(
amount: Int,
speed: Int
)
fun reset()