EntityOverlayBatch:addThisFrame

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

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