Blips
Blips display icons and areas on the map and minimap. Create them in client
scripts with PointBlip, RadiusBlip or AreaBlip.
Choose a blip type
Section titled “Choose a blip type”| Class | Constructor arguments | Use |
|---|---|---|
PointBlip |
x, y, z |
An icon at a location. Supports sprites and entity attachments. |
RadiusBlip |
x, y, z, radius |
A circular area centred at the position. |
AreaBlip |
x, y, z, width, height |
A rectangular area centred at the position. Width and height describe its map footprint. |
Coordinates and sizes use metres. Radius, width and height must be positive and
finite. radius and size are read-only, so create a replacement to resize an
area. Assign pos to move any unattached blip.
This example creates a destination with a route, a circular zone around it and a nearby rectangular area:
// @ts-check/// <reference types="@revomp/types-client" />import * as revo from 'revo-client';
const checkpoint = { x: -1220, y: -1765, z: 3.9 };
const destination = new revo.PointBlip(checkpoint.x, checkpoint.y, checkpoint.z);destination.sprite = revo.BlipSprite.Raceflag;destination.name = 'Beach checkpoint';destination.color = revo.BlipColor.Blue;destination.routeColor = revo.BlipColor.Blue;destination.route = true;
const zone = new revo.RadiusBlip(checkpoint.x, checkpoint.y, checkpoint.z, 50);zone.color = revo.BlipColor.Blue;zone.alpha = 70;
const area = new revo.AreaBlip(-1180, -1730, 3.9, 40, 20);area.color = revo.BlipColor.Green;area.alpha = 100;area.heading = Math.PI / 4;Blips only provide the map display. Add a colshape to detect entry into an area, or a marker to show it in the game world.
Appearance and display
Section titled “Appearance and display”| Property | Use |
|---|---|
sprite |
Point blip icon from BlipSprite or a numeric sprite ID. |
name |
Label displayed on the map. |
color |
GTA palette index from BlipColor or a number from 0 to 255. |
alpha |
Opacity from 0 to 255. Defaults to 255. |
scale |
Positive finite scale factor. Defaults to 1. |
heading |
Rotation in radians. Point icons stay upright until you assign a rotation. |
shortRange |
Limits minimap display to nearby locations. Defaults to false. |
display |
GTA display mode. Defaults to 2 for the map and minimap. Use 3 for the map only or 5 for the minimap only. |
priority |
GTA display priority from 0 to 255. Defaults to 0. |
Color uses the game’s palette. Transparency is set separately through alpha.
The display values follow GTA’s blip display modes.
Set visible = false to hide a blip and true to show it again under its current
display settings. Hiding also suppresses its route.
For flashing, set flashes = true. flashInterval is a positive interval in
milliseconds, with a default of 1,000. flashTimer sets the duration in
milliseconds, or -1 for indefinite flashing. flashesAlternate enables GTA’s
alternate flashing effect.
Call blip.fade(0, 1000) to fade to transparent over one second. The first argument
is the target alpha and the second is the duration in milliseconds. A zero
duration applies the alpha immediately. Fading to zero leaves the object valid.
Routes
Section titled “Routes”Enable destination.route on a point blip to show a GPS route to it. Set
routeColor independently from the icon’s color. Assign route = false when
the route is no longer needed.
For an area destination, place a point blip at the intended arrival location and enable its route, as in the example above. Arrival detection belongs in your interaction logic, using a colshape or a position check.
Follow an entity
Section titled “Follow an entity”Only point blips support attachTo(entity). This helper accepts an existing
vehicle and returns a blip that follows it:
// @ts-check/// <reference types="@revomp/types-client" />import * as revo from 'revo-client';
/** @param {revo.Vehicle} vehicle */export function createVehicleBlip(vehicle) { const { x, y, z } = vehicle.pos; const blip = new revo.PointBlip(x, y, z);
blip.sprite = revo.BlipSprite.SportsCar; blip.name = 'Mission vehicle'; blip.color = revo.BlipColor.Green; blip.attachTo(vehicle);
return blip;}The attachment updates the blip’s position and dimension automatically.
attachedTo returns the target entity, and isAttached reports whether an
attachment exists. Calling detach() leaves the blip at its last position.
When the target streams out, the blip keeps its last position. It resumes following when the target streams back in. Destroying the target detaches the blip and leaves it at that position. Destroy the blip too if it should disappear.
The icon keeps its own heading. Set heading yourself if it needs to indicate
the target’s direction.
Dimensions and lifetime
Section titled “Dimensions and lifetime”Blips have no distance-based streaming cutoff. streamDistance does not limit
their range, and shortRange affects GTA’s display while the Revo object remains
active.
Unattached blips start in dimension 0. Set dimension to another dimension or
globalDimension as needed. An attached point blip follows its target’s dimension.
See Dimensions and visibility.
You can configure a blip immediately after construction. Its GTA handle is created
on an active game frame. If you need it for a native call, read scriptId when it
is nonzero. A dimension change can remove and recreate the handle, so keep the
blip object instead of caching the handle.
Blips are local to each client. Send destination data from the server when it should be shared, and create the appropriate blips on the receiving clients.
Call blip.destroy() to remove it. Repeated calls have no effect. Blips created
by a resource are also removed when the resource stops.