我正试图弄清楚如何将Pixi.js与Meteor一起使用,但我得到的都是黑屏。以下是Meteorpad的一个例子:
http://meteorpad.com/pad/F23Du5XsCKMw9ZrWa
有人能帮忙解决可能出现的问题吗?
感谢
好吧,我想明白了,我之前的代码:
var stage = new PIXI.Stage(0x66FF99),
renderer = new PIXI.autoDetectRenderer( 900,500, document.getElementById("stage")),
texture0 = PIXI.Texture.fromImage('http://www.greensock.com/_img/codepen/bezierCreature/creature.png');
kzRocket = new PIXI.Sprite(texture0);
kzRocket.position.x = 30;
kzRocket.position.y = 140;
stage.addChild(kzRocket);
它在结尾处缺少呈现调用。这是为其他像我一样陷入困境的人提供的固定版本。
var stage = new PIXI.Stage(0x66FF99),
renderer = new PIXI.autoDetectRenderer( 900,500, document.getElementById("stage")),
texture0 = PIXI.Texture.fromImage('http://www.greensock.com/_img/codepen/bezierCreature/creature.png');
kzRocket = new PIXI.Sprite(texture0);
kzRocket.position.x = 30;
kzRocket.position.y = 140;
stage.addChild(kzRocket);
renderer.render(stage);