1 decade ago by Fooshi
I have used the button plugin, the i have created an extended entity in my main init function() like this :
but it display me juste one character when the draw function of the entity button is called :
this.text.length send me juste 1 character.
What can be the problem ?
thank you
final = ig.game.spawnEntity(button,0,150, { text : ["Tu a gagné"], textLength : 7, textPos : {x:145, y:50}, anim : false, size : {x:320, y:168}, animSheet : new ig.AnimationSheet('media/final.png', 320, 168) }); final.state = 'hidden';
but it display me juste one character when the draw function of the entity button is called :
draw: function() { if (this.state !== 'hidden') { this.parent(); for (var i=0; i<this.text.length; i++) { ig.game.font.draw( this.text[i], this.pos.x + this.textPos.x - ig.game.screen.x + (i*10), this.pos.y + ((ig.game.font.height + 2) * i) + this.textPos.y - ig.game.screen.y, this.textAlign ); } } },
this.text.length send me juste 1 character.
What can be the problem ?
thank you