EntityOverlayBatch:add

From RAGE Multiplayer Wiki
Revision as of 09:20, 4 August 2024 by Shr0x (talk | contribs) (Created page with " {{ClientsideJsFunction}} {{JSContainer| This method will add an entity to overlay batch. ===Required Params=== *''' entity: ''' {{RageType|Entity}} ===Return value=== *''' {{RageType|void}} ''' ==Syntax== <syntaxhighlight lang="javascript"> batch.add(entity); </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //Enable entity overlay batch. mp.game.graphics.setEntityOverlayPassEnabled(true); //Create a new entity overlay batch. let batch = mp.game.gra...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax

This method will add an entity to overlay batch.

Required Params

  • entity: Entity

Return value

  • void

Syntax

batch.add(entity);

Example

//Enable entity overlay batch.
mp.game.graphics.setEntityOverlayPassEnabled(true);
//Create a new entity overlay batch.
let batch = mp.game.graphics.createEntityOverlayBatch(overlayParams);

//Add a vehicle to overlay batch once the player enters in them.
mp.events.add('playerEnterVehicle', (vehicle) => {
    batch.add(vehicle);
});


See also