LogoPixi’VN

Canvas (WebGL/WebGPU)

Overview of how Pixi’VN uses PixiJS for rendering, differences between Pixi’VN and PixiJS, and how to interact with the canvas and debugging tools.

Pixi’VN uses PixiJS — a 2D WebGL/WebGPU rendering engine — to draw everything on screen. The Pixi’VN API wraps PixiJS to let you add, update, and remove images, text, and animations while automatically keeping track of the canvas state, so it can be saved and restored correctly across game saves and loads.

Use

ink

You can use this method with the ink syntax. See more here.

To interact with the PixiJS application, you can use the canvas element, which acts as a wrapper. With it, you can add the set of components provided by Pixi’VN and start animations.

import { canvas, Sprite } from "@drincs/pixi-vn"; 

export const startLabel = newLabel("start", [
    () => {
        let sprite = new Sprite({}); 
        canvas.add("sprite", sprite); 
    },
]);

Other features

On this page