Skip to content

Commit

Permalink
Compatibility with OpenFL 8's AIR target
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 committed Apr 22, 2018
1 parent 7b33779 commit d25eb11
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions flixel/FlxG.hx
Expand Up @@ -321,7 +321,13 @@ class FlxG
#if openfl_legacy
stage.resize(Width, Height);
#else
Lib.application.window.resize(Width, Height);
#if air
var window = flash.desktop.NativeApplication.nativeApplication.activeWindow;
window.width = Width;
window.height = Height;
#else
Lib.application.window.resize(Width, Height);
#end
#end
#end
}
Expand Down Expand Up @@ -619,7 +625,11 @@ class FlxG
renderMethod = DRAW_TILES;
#end
#end


#if air
renderMethod = BLITTING;
#end

renderBlit = renderMethod == BLITTING;
renderTile = renderMethod == DRAW_TILES;

Expand All @@ -644,7 +654,7 @@ class FlxG
timeScale = 1.0;
elapsed = 0;
maxElapsed = 0.1;
worldBounds.set( -10, -10, width + 20, height + 20);
worldBounds.set(-10, -10, width + 20, height + 20);
worldDivisions = 6;
}

Expand Down
4 changes: 2 additions & 2 deletions include.xml
Expand Up @@ -3,8 +3,8 @@
<icon path="assets/images/logo/HaxeFlixel.svg" />

<section unless="unit-test">
<assets path="assets/sounds" rename="flixel/sounds" include="*.mp3" if="web" embed="true" />
<assets path="assets/sounds" rename="flixel/sounds" include="*.ogg" unless="flash" embed="true" />
<assets path="assets/sounds" rename="flixel/sounds" include="*.mp3" if="web || air" embed="true" />
<assets path="assets/sounds" rename="flixel/sounds" include="*.ogg" unless="flash || air" embed="true" />
</section>

<assets path="assets/fonts/nokiafc22.ttf" rename="flixel/fonts/nokiafc22.ttf" embed="true" />
Expand Down

0 comments on commit d25eb11

Please sign in to comment.