Custom screen rotation ads for mobile targets.
haxelib install screen_orientation
<haxelib name="screen_orientation" />
...
import Screen_orientation;
class Main extends Sprite
{
public function new()
{
super();
addChild(new FlxGame(0, 0, PlayState));
/*Order parameters:
1.- Title.
2.- Message.
3.- Graphic asset.
4.- Back color (OPTIONAL).
5.- Time to evaluate screen condition (OPTIONAL).
6.- Inclination of the device (OPTIONAL). Range (0 to 1).
7.- Custom FlxSubstate (OPTIONAL).
*/
Screen_orientation.DetectOrientationDevice("Rotate to Landscape", "touch to close", "assets/images/icon.png", FlxColor.GREEN, 0.5, 0.5, null);
}
}
...
...
import Screen_orientation;
class Main extends Sprite
{
public function new()
{
super();
addChild(new FlxGame(0, 0, PlayState));
/*Order parameters:
Respect the type of data in each parameter. It is mandatory to pass the instance of a FlxSubState class already programmed by the developer.
*/
Screen_orientation.DetectOrientationDevice("", "", "", null, 0.5, 0.5, new YourCustomClassFlxSubState());
}
}
The MIT License (MIT) - LICENSE.md
Copyright © 2019 MilköGames (http://www.milkogames.xyz)
Author: Nicolás Capel