1 decade ago by Ransome
I'm making a series of minigames using Impact and there are a lot of custom images thrown in, so I made a generic EntityImpactImage which would load an image but I could treat like an entity. It has its own draw code and a rudimentary scaling. I can select the entity from the entity pulldown in Weltmeister but as it loads dynamic content nothing shows up, so I'm trying to get Welty to draw a box I can use for reference. I set the usual _wm properties, and when I create the entity it seems to appear in the map file but the guide boxes don't appear. Here's the code:
Any thoughts on why the draw box isn't showing up? Maybe I missed a step?
ig.module(
'game.entities.ui.impactimage'
).requires(
'impact.entity'
).defines(function() {
EntityImpactimage = ig.Entity.extend({
_wmDrawBox:true,
_wmScalable:true,
_wmBoxColor:'#FF00000',
size:{x:20,y:20},
collides: ig.Entity.COLLIDES.NEVER,
/* settings:
* {img:ig.Image('imagefilename')}
* width height
*/
init: function(x,y,settings) {
this.parent(x,y,settings);
this.image = ig.copy(this.img);
if(typeof(this.scale) != 'undefined') {
this.image.resize(this.scale);
this.image.width = this.image.width * this.scale;
this.image.height = this.image.height * this.scale;
}
},
draw: function() {
this.parent();
this.image.draw(this.pos.x,this.pos.y);
}
});
});
Any thoughts on why the draw box isn't showing up? Maybe I missed a step?
