Closed llPekoll closed 2 years ago
@llPekoll For now you can dynamically resize by binding to the Application instance and calling app.renderer.resize()
.
<script>
import { Application } from 'svelte-pixi'
let app
let width
let height
$: if (app && width && height) {
app.renderer.resize(width, height)
}
</script>
<svelte:window bind:innerHeight={height} bind:innerWidth={width} />
<Application bind:instance={app}>
</Application>
I'll consider adding this as the behaviour for the width/height props, I think it makes sense to do that. Currently the Application component more-or-less just sends the props to new PIXI.Application
and has no reactivity on them after that.
Hi, I am trying to resize application on the fly, I've try to do it using
<svelte:window bind:innerWidth={w} bind:innerHeight={h} />
even tryiedonMount(aync()=>{window.innerWidth={w};})
then