Skip to content

Zenkai Opcode PanCameraToPosition

Johnathon edited this page Sep 20, 2026 · 1 revision

PanCameraToPosition

Pans the camera so the top-left of the viewport reaches (x, y), blocking the script until the pan finishes.

Syntax

PanCameraToPosition(x, y, speed)

Parameters

x
Integer
X of the top-left of the viewport, in world pixels (not the centre; the viewport is 240x160). To centre on world point wx, pass wx - 120.

y
Integer
Y of the top-left of the viewport, in world pixels. To centre on world point wy, pass wy - 80.

speed
Integer
Pan speed. Larger is faster.

Remarks

The same pan as CenterCameraOnChar, aimed at a position instead of a character.

Examples

Minimal illustrative encoding (synthetic, not from a real ROM script):

0x00, N           // PushByte(x)
0x00, N           // PushByte(y)
0x00, N           // PushByte(speed)
0x02, 0x1F        // Step -> PanCameraToPosition

See Also

Applies To

Game Notes
Legacy of Goku 2 Supported

Clone this wiki locally