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 fulvio

I often test on my desktop browser rather than iOS sometimes and I'm forever commenting and un-commenting the following plugin as desktop browsers do not support the functions within:

ig.module('game.main').requires(
    ...

    'plugins.ios.ios'
}

My question is whether or not a plugin can be added only for mobile devices by using something like ig.ua.mobile?

1 decade ago by fulvio

I was hoping @dominic would be able to lead me in the right direction with this one.

1 decade ago by dominic

In you main.js, outside of the game.main module:

if( ig.global.ios ) {
	ig.module('game.ios-dummy')
		.requires('plugins.ios.ios')
		.defines(function(){});
}

ig.module('game.main')...

This will define an empty dummy module when running inside iOSImpact. It's quite a hack though and I'm not sure if the bake script will like it.

Spoiler: In the upcoming iOSImpact version you wont need the plugins anymore.

1 decade ago by fulvio

@dominic: It works perfectly. Thank you!
Page 1 of 1
« first « previous next › last »