Skip to content
imshooter edited this page Oct 17, 2026 · 1 revision

The screen natives work out what a player sees from the camera their client sends, and give positions in the units of text draws.

Native Question
A3D_WorldToScreen Where does a point of the world show?
A3D_ScreenToWorld Which way does a point of the screen look?
A3D_GetScreenTarget What does a point of the screen show?
A3D_IsPointOnScreen Does a point show, and is it hidden?
A3D_GetPlayersOnScreen, A3D_GetVehiclesOnScreen, A3D_GetActorsOnScreen Who shows?

Coordinates

The screen is 640 units across and 448 down, from the top left corner, the units every text draw uses whatever the resolution of the player. Its centre is 320.0, 224.0, the point the camera looks at.

A point beside the screen gets coordinates beyond it, below 0.0 or past 640.0 and 448.0. A point behind the camera gets none.

The camera

The client sends its camera with the aim data, while the player is on foot:

  • its position and the direction it looks in,
  • its zoom, which open.mp turns into the field of view across the screen: 70 degrees normally and down to 35 when a weapon or the camera zooms in,
  • the aspect ratio of the screen, such as 1.33 for 4:3 and 1.78 for 16:9.

The height of the view follows from its width and the aspect ratio. Without a zoom or an aspect ratio, 70 degrees and 4:3 are used. For a player who has not sent a camera yet, every native returns false or finds no one.

Limits

  • The data is the last the client sent, so a camera that turns fast is a little behind.
  • The client sends its camera while the player is on foot, so in a vehicle the last camera sent may be old.
  • Bots of the NPC component fill the zoom and the aspect ratio with values of their own, so only a real client shows whether a mark sits right on the screen.
  • Mods that change the field of view or stretch the screen move what the player sees away from what the component works out.

Example

A mark that stays over a vehicle is on the page of A3D_WorldToScreen. An air strike on a grid of clickable cells is on the page of A3D_GetScreenTarget.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally