Creating your own draw function on top of me.Entity or any other renderable is fine, you just need to make sure you call the parent as well:
draw: function(renderer) {
this._super(me.Entity, 'draw', [renderer]);
// your code here
}
On Thursday, July 21, 2016 at 8:18:23 PM UTC-4, Dan Hunter wrote:
> Would there be any reason why adding text above an entity would cause it to disappear?
>
>
> I modified the platformer example game.PlayerEntity and added this into the init:this.tag = new me.Font("Arial", 14, "white");
>
>
> then added a draw function just like this:
>
> draw: function(renderer){
> this.tag.draw(renderer, "test", this.pos.x-5, this.pos.y-25);
> },
>
>
> and I get this result:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>