1 decade ago by Elvar
What's up fellas
I have a question I hope y'all can help me with.
I am trying to draw an image on top of an entity, based on the current player color, in a multiplayer tower defense.
So let me explain a little:
I have a function in a self made util class that named ftd (short for Fantasy TD).
This function returns the current player with all it's attributes (I just need the player.color for this one).
What I am trying to do is to draw an image on top of my tower entity, so that when I place a tower, the flag (based on player.color) is placed on top of the placed tower, according to the tower positions and the pixel size of the image.
Now.. I can place the tower, all the positions have been logged and they are correct, the path is correct, I'm given no warnings in the console, and I receive the banner_0.png in "Network".
But.. I get no entity drawn in the debugger, and I can't see the image in the canvas..
Can someone please help me? I'm really desperate ^_^
Thank you in advance!
I have a question I hope y'all can help me with.
I am trying to draw an image on top of an entity, based on the current player color, in a multiplayer tower defense.
So let me explain a little:
I have a function in a self made util class that named ftd (short for Fantasy TD).
This function returns the current player with all it's attributes (I just need the player.color for this one).
placeTowerFlag : function() { var player = ftd.getCurrentPlayer(); var bannerImg = new ig.Image( 'media/banner/banner_' + player.color + '.png' ); var _x = (this.pos.x + this.size.x) - bannerImg.width; var _y = (this.pos.y + this.size.y) - bannerImg.height; bannerImg.draw( _x, _y ); },
What I am trying to do is to draw an image on top of my tower entity, so that when I place a tower, the flag (based on player.color) is placed on top of the placed tower, according to the tower positions and the pixel size of the image.
Now.. I can place the tower, all the positions have been logged and they are correct, the path is correct, I'm given no warnings in the console, and I receive the banner_0.png in "Network".
But.. I get no entity drawn in the debugger, and I can't see the image in the canvas..
Can someone please help me? I'm really desperate ^_^
Thank you in advance!