I am working on a project using Meteor with Pixi.js, and I'm facing a very strange problem when I try to use a router (I tried both IronRouter and FlowRouter), and a pixi canvas.
The canvas is built, but i cant render any sprite on it. This happen only when i use a route parameter, such as '/game/:id'
This is working except when i use a route parameter, such as '/game/:id' More, if i dont use route parameter, Sprite is showing up when i access '/game' Sprite doesn't show up when i access '/game/
Here is a minimal error code on a meteor app :
Any Router definition :
Router.route('/room/:_id', {
action: function() {
this.render('game');
}
});
A basic template : Html :
<template name="game"></template>
Js :
Template.game.onRendered(function () {
PIXI.loader.add("assets/mario.png")
.load(() => {
let app = new PIXI.Application();
document.body.appendChild(app.view);
let mario = new PIXI.Sprite(PIXI.loader.resources["assets/mario.png"].texture);
mario.position.set(5, 5);
mario.width = 48;
mario.height = 48;
app.stage.addChild(mario);
app.render();
});
});
The pixi canvas will show up but mario sprite doesn't.