EntityOverlayBatch:addThisFrame

From RAGE Multiplayer Wiki

Client-Side
Function

 JavaScript



JavaScript Syntax

This method will add an entity to overlay batch only this frame.

Required Params

  • entity: Entity

Return value

  • void

Syntax

batch.addThisFrame(entity);

Example

//Enable entity overlay batch
mp.game.graphics.setEntityOverlayPassEnabled(true);

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

//Add streamed vehicles to overlay batch.
mp.events.add('render', () => {
    mp.vehicles.forEachInStreamRange((vehicle) => {
        batch.addThisFrame(vehicle);
    })
});


See also