Legacy:Functions/Map/Camera
From Spherical
< Legacy:Functions | Map
Following persons
- API:AttachCamera(person): Make the camera follow person.
- API:DetachCamera(): Stop the camera from following any person.
- API:IsCameraAttached(): Check if the camera is attached to a person.
- API:GetCameraPerson(): Get the name of the person the camera is attached to.
Camera position
- API:GetCameraX(): Get the map X coordinate the camera is focusing on.
- API:SetCameraX(x_pos): Set the X coordinate of the camera.
- API:GetCameraY(): Get the map Y coordinate the camera is focusing on.
- API:SetCameraY(y_pos): Set the Y coordinate of the camera.
Coordinate conversion
- API:MapToScreenX(layer, x): Convert a map X coordinate to screen X.
- API:MapToScreenY(layer, y): Convert a map Y coordinate to screen Y.
- API:ScreenToMapX(layer, x): Convert a screen X coordinate to map layer X.
- API:ScreenToMapY(layer, y): Convert a screen Y coordinate to map layer Y.