Phaser API Documentation

  Version: 
endDraw()

Description:

Use this method to finish batch drawing to this Render Texture.

Never call this method without first calling beginDraw.

It is faster than calling draw, but you must be very careful to manage the flow of code and remember to call endDraw(). If you don't need to draw large numbers of objects it's much safer and easier to use the draw method instead.

The flow should be:

// Call once:
RenderTexture.beginDraw();

// repeat n times:
RenderTexture.batchDraw();
// or
RenderTexture.batchDrawFrame();

// Call once:
RenderTexture.endDraw();

Do not call any methods other than batchDraw, batchDrawFrame, or endDraw once you have started a batch. Also, be very careful not to destroy this Render Texture while the batch is still open, or call beginDraw again.

Returns:
Description:

This Render Texture instance.