Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by alexandre

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');
}

1 decade ago by alexandre

Hmm. Inside my entity's draw method, ig.global.wm remains undefined, whether called from within wm or not.

1 decade ago by Datamosh

It is very strange! inside draw method of my entities ig.global.wm has a lot of stuff on weltmeister.

1 decade ago by alexandre

derp! browser cache problem.
Now it works.
Thanks!

1 decade ago by stahlmanDesign

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 »