This demo demonstrate how to use render targets, which are special textures you can draw on and later draw on screen.
The demo is very similar to the sprites demo, but here instead of drawing directly on screen we draw on a texture first and then draw that texture on screen with a tilt.
Use Arrows or WASD to move the player. Collision detection is very basic so don't expect much from it.
The following is a minimal code example on how to use sprites.
// create render target
let renderTarget = await Shaku.assets.createRenderTarget('_my_render_target', width, height);
// part below goes between startFrame() and endFrame()
// -------------------------------------------------------
// set render target
Shaku.gfx.setRenderTarget(renderTarget);
// draw some stuff here...
// reset render target
Shaku.gfx.setRenderTarget(null);
// you can now use 'renderTarget' just like you would with any texture, and it will contain everything you drawn on it.
// note: due to WebGL limitation, render targets are flipped upside-down. to correct that, set height to a negative value.