1 decade ago by Silent
Hello.
I have a UI entity that I want to draw things such as HP, MP and gold on. I copied the code form Impact's Hello World, but it doesn't seem to work.
Can someone please help me find out what's wrong?
Thanks in advance.
I have a UI entity that I want to draw things such as HP, MP and gold on. I copied the code form Impact's Hello World, but it doesn't seem to work.
EntityUiIdle = ig.Entity.extend({ size: {x: 160, y: 32}, animSheet: new ig.AnimationSheet('media/uiIdle.png', 160, 32), font: new ig.Font( 'media/04b03.font.png' ), init: function (x, y, settings) { this.parent(x, y, settings); this.addAnim('default', 1, [0]); ig.game.spawnEntity(EntityPortrait, 1, 102, this.zIndex + 1); ig.game.spawnEntity(EntityClass, 1, 93, this.zIndex + 1); ig.game.sortEntitiesDeferred(); }, update: function () { this.parent(); this.font.draw("Hello World!!", 1, 110); } });
Can someone please help me find out what's wrong?
Thanks in advance.