Construct 3 icon

Construct 3

Documentation

Drawing canvas script interface

Ashley's avatar
Medal
Construct Team Founder
Published 22 Aug, 2019
68 words
<1 min

The IDrawingCanvasInstance interface derives from IWorldInstance to add APIs specific to the Drawing Canvas plugin.

Drawing Canvas APIs

async getImagePixelData()

Takes a snapshot of the drawing canvas pixel state on the GPU, and reads it back to the CPU asynchronously. Resolves with an ImageData representing the pixel data. Note this uses unpremultiplied alpha, whereas the surface on the GPU is premultiplied, so technically this is lossy.