Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

10 years ago by manuelac

How can I update ig.game.font.draw() coordinates ?

// in entities/creep.js
},
draw: function() {
  ig.game.font.draw(this.hp, this.pos.x, this.pos.y);
}

this doesnt work. it effectively draws the creeps HP but the position is way off... it is not on top of the entity.

any ideas?

10 years ago by Joncom

You may have to account also for screen position.

draw: function() {
    var x = this.pos.x + ig.game.screen.x;
    var y = this.pos.y + ig.game.screen.y;
    ig.game.font.draw(this.hp, x, y);
}

10 years ago by manuelac

thanks this solved this problem :)
Page 1 of 1
« first « previous next › last »