In my entity's draw method, I want to add some extra drawing code when it is inside WM.
So, how do I detect whether or not the current context is WM's?
Thanks in advance.
EDIT
relevant forum post here
1 decade ago
by lazer
I think you might be looking for something like this:
if( ig.global.wm ) {
console.log('In Weltmeister');
}
Hmm. Inside my entity's draw method, ig.global.wm remains undefined, whether called from within wm or not.
It is very strange! inside draw method of my entities ig.global.wm has a lot of stuff on weltmeister.
derp! browser cache problem.
Now it works.
Thanks!
I noticed that if you use ig.game.sortEntitiesDeferred() in your entity init() it will cause an error in Weltmeister.
So you can do this:
this.zIndex = -99;
//don't resort if in weltmeister
if (!ig.global.wm)ig.game.sortEntitiesDeferred();
Page 1 of 1
« first
« previous
next ›
last »