I'm trying to mount a pixi.js
canvas with Svelte like below. app.view
is an HTML Canvas
element but I'm not sure how to display it with Svelte.
<script>
import * as PIXI from 'pixi.js'
import { onMount } from 'svelte';
let app = new PIXI.Application({
width: 256, // default: 800
height: 256, // default: 600
antialias: true, // default: false
transparent: false, // default: false
resolution: 1 // default: 1
})
</script>
<style></style>
<app.view />
I'm just using this for the time being but it would be great to be able to add it to the template.
onMount(() => {
document.body.appendChild(app.view);
})