Lua · Variables · World

view

Your own live camera window, drawn like Third Person.

One window per frame for all scripts together; the first call wins. It costs one extra map draw while it is on. Needs map data.

FunctionWhat it does
view.window(x, y, w, h, options)Shows the map from any point. Call it in on_frame every frame you want it.

#view.window

view.window(x, y, w, h, options)

Shows the map from any point. Call it in on_frame every frame you want it.

Arguments

x, y, w, hnumber
Screen rectangle.
optionstable
pos (camera point, required), look_at (vector) or angles ({pitch, yaw}), zoom (0.3 to 4, default 1).

Returns

boolean
false when another window already took this frame or map data is missing.
Example
local w, h = draw.screen()
view.window(w - 384, 120, 360, 203, { pos = vec.new(x, y, z + 120), look_at = site })