0
J'ai un problème lors de la création d'une image-objet à partir de BitmapData. Lorsque j'ai une forme rectangulaire, l'image-objet est créée sans problème, mais lorsque bitmapData est juste une ligne, l'image-objet est juste vide.Sprite à partir de la ligne BitmapData
bmd = this.game.add.bitmapData(this.line.width, this.line.height);
//This works fine:
bmd.ctx.rect(0, 0, 32, 32);
bmd.ctx.fillStyle = "#0f0";
bmd.ctx.fill();
var platform = this.game.add.sprite(this.line.midPoint().x, this.line.midPoint().y, bmd);
//This doesn't work
bmd.ctx.this.lineWidth = "8";
bmd.ctx.strokeStyle = 'white';
bmd.ctx.moveTo(this.startPoint.x, this.startPoint.y);
bmd.ctx.lineTo(this.endPoint.x, this.endPoint.y);
bmd.ctx.stroke();
var platform = this.game.add.sprite(this.line.midPoint().x, this.line.midPoint().y, bmd);
est-il un problème de savoir ou dois-je une erreur horrible dans mon code?
Merci pour votre temps