OpenFL 9.5.0, Lime 8.3.0, and SWF 3.4.0 Release

Hey, everyone!

Grab the latest feature releases for OpenFL, Lime, and SWF from Haxelib.

haxelib install lime 8.3.0
haxelib install openfl 9.5.0
haxelib install swf 3.4.0

Let’s take a moment to highlight a few selected improvements, but you can also read through the full changelog at the end.

  • In OpenFL, the scale9Grid property now supports adjusting vectors in the Graphics class, which greatly improves compatibility with Flash’s behavior.
  • The Screen class in OpenFL and the Display class in Lime now each provide a safeArea property, which you may use to check if the current device has notches or cutouts (supported on iOS, Android, and macOS).
  • The Stage class in OpenFL and the Application class in Lime now provide a number of new APIs to related to device and stage orientation, including events that you may listen to, such as StageOrientationEvent.ORIENTATION_CHANGE in OpenFL.
  • A new rumble() method was added to the Gamepad class in Lime.
  • TextFormat in OpenFL and the Font class in Lime now support strikethrough formatting.
  • OpenFL’s Stage 3D now supports several new AGAL2 opcodes.
  • We upgraded the version of HashLink binaries bundled with Lime to 1.14.
  • To meet current Google Play requirements for Android, the default target SDK version has been increased 35, and Lime’s binaries are built with NDK 28 to support 16KB native library alignment.

Changelogs

OpenFL 9.5.0 Changelog

  • Added new, more accurate scale9Grid implementation for Graphics. Set the new openfl_legacy_scale9grid define to restore legacy behavior.
  • Added orientation, deviceOrientation, supportedOrientations, supportsOrientationChange and autoOrients properties, setOrientation() method, and StageOrientationEvent.ORIENTATION_CHANGE event to Stage. You must check the value of supportsOrientationChange to determine if they may be used on the current target.
  • Added safeArea property to Screen to get the region of the screen without cutouts or rounded corners.
  • Added BevelFilter implementation.
  • Added passwordChar property to TextField to allow customizing the password mask character.
  • Added strikethrough property to TextFormat to allow rendering a line striking out the text.
  • Added getFileBytes(), getFileText(), saveBytes(), and saveText() static helper methods to File class.
  • Added implementation of AGAL2 opcodes ddx, ddy, ife, ine, ifg, ifl, els, and eif to Stage 3D.
  • Added IDisplayObjectLoader interface for loading custom openfl.display.Loader content.
  • Added LARGE_HXSF and LARGE_JSON to ObjectEncoding to support reading and writing larger objects with ByteArray.
  • Added support for rendering more than 16384 tiles in Tilemap.
  • Added Event.CLOSING event to NativeWindow, which may be cancelled.
  • Added readable type property to NativeWindow, but it cannot yet be customized in NativeWindowInitOptions.
  • Added static ofValues() helper function to Vector as an alternative to ofArray() that accepts a ...rest argument instead of an array.
  • Added support for drawEllipse(), drawCircle(), and drawRoundRect() with basic fills (but no strokes) when Graphics is forced to be rendered in hardware.
  • Added bitmap and shader fills when using drawRect() and Graphics is forced to be rendered in hardware.
  • Added solid color fills when using drawTriangles() and drawQuads() and Graphics is forced to be rendered in hardware.
  • Added setter for url property on File class.
  • Added ...rest argument to the push() method of Vector when the Haxe version is 4.2 or newer.
  • Added internal clippingLayer property to DisplayObject for use with SWF library to support shared masks.
  • Added metaData property to DisplayObject for potential future use by SWF library.
  • Added support for externalizable traits in AMF ByteArray data.
  • Added support for vectors in AMF ByteArray data.
  • Fixed missing final ProgressEvent.PROGRESS before Event.COMPLETE on Sound load.
  • Fixed missing detection of new mouse target after mouse events or transformation, including dispatch of appropriate over/out events.
  • Fixed values of setSelection() getting lost while dragging selection in TextField when it has not scrolled.
  • Fixed default caret and selection indices on TextField to be 0.
  • Fixed missing exceptions when calling getLineText() and getLineOffset() with negative line numbers.
  • Fixed openfl.utils.Object incorrectly returning a function unbound to this when resolving with member access on HTML5 target.
  • Fixed passing null for uvtData parameter when calling drawTriangles() on Graphics.
  • Fixed gradient fill not getting cleared when forcing hardware rendering of Graphics.
  • Fixed incorrect align behavior on Stage when scaleMode is NO_BORDER or SHOW_ALL.
  • Fixed BitmapData with disposeImage() recreating shaders too frequently to improve performance.
  • Fixed DisplayObject failing to dispose some of its cacheAsBitmap internal BitmapData objects to improve memory usage.
  • Fixed Graphics rendering not clearing an internal flag in some situations, leading to rendering every frame unnecessarily.
  • Fixed loaderInfo.width and loaderInfo.height not being initialized with the dimensions of the first window.
  • Fixed opaqueBackground on DisplayObject not rendering correctly.
  • Fixed fillRect() on BitmapData when backed by a hardware texture.
  • Fixed using incorrect underline position and thickness on native targets that use Cairo, when available.
  • Fixed compatibility with Haxe 5 IMap interface on Dictionary.
  • Fixed durationchanged event listener type on video to durationchange in NetStream on HTML5 target.
  • Fixed many variables that defaulted to Dynamic because they did not declare a type and were not initialized.
  • Fixed use of newer setTransform() overload on HTML5 target to use older overload for wider browser compatibility.
  • Changed URLVariables to remove support for ; as a delimiter for better compatibility with Flash, which uses only the & character.
  • Changed index.html template to use mobile-web-app-capable instead of deprecated apple-mobile-web-app-capable.
  • Changed Graphics and TextField on the HTML5 target to reuse BitmapData to improve performance and to properly dispose texture to improve memory usage.
  • Changed TextField on the HTML5 target to remove an implicit moveTo() on its internal Graphics, to improve performance and fix issues after implementing scale9Grid.
  • Changed Assets.getMusic() to fall back to getSound() if music isn’t a Vorbis file.

Lime 8.3.0 Changelog

  • Added onDisplayOrientation and onDeviceOrientation events to Application to detect mobile device orientation changes.
  • Added safeArea property to Display to detect region safe from cutouts and rounded corners.
  • Added rumble() method to Gamepad.
  • Added -json flag, which works similarly to the -xml flag, but outputs types in JSON format.
  • Added layoutInDisplayCutoutMode to <config:android>, which may be set to default, always, never, or shortEdges.
  • Added support for Windows resource file to set metadata in executable.
  • Added pannerAttr() method to Howler to configure panner node’s attributes for a sound or group of sounds.
  • Added addString() method to HBBuffer to properly handle encoding conversions in native code.
  • Added screensize and screenDPI to <config:air> to customize the mobile simulator.
  • Added onUncaughtError event to ThreadPool to allow main thread to handle exceptions in doWork.
  • Added strikethroughPosition and strikethroughThickness to Font.
  • Added separate lime-openalsoft and lime-mojoal defines to help detect which library is used.
  • Added gradle-properties to <config:android> to customize properties for Android Gradle builds.
  • Fixed missing hl-ver define to configure the Haxe compiler to target Lime’s bundled HashLink (unless a custom HL_PATH is set).
  • Fixed display of preload progress for packed asset libraries.
  • Fixed mouse move and mouse up event failing to dispatch outside window bounds when mouse button is down.
  • Fixed hardware attribute not being set on context creation.
  • Fixed some window properties not getting set properly from attributes on window creation.
  • Fixed performance issues in ThreadPool by overhauling job scheduling.
  • Fixed exception on Windows when exiting program by using SDL_QuitSubSystem in native code.
  • Fixed separate private variables for visible and hidden that got out of sync.
  • Fixed crash on HashLink when passing NULL device to OpenAL bindings.
  • Fixed many variables that defaulted to Dynamic because they did not declare a type and were not initialized.
  • Fixed ThreadPool throwing an exception when Application.current is null.
  • Fixed old run.n in Haxelib because the CI server did not build it.
  • Changed Android rebuild to use NDK r28c for Haxelib to support new 16KB native library aligment requirement.
  • Changed Android target SDK version to 35. May require updating to JDK 17 or newer.
  • Changed default Android architecture for x86 from x86_32 to x86_64 (can still rebuild x86_32 manually).
  • Changed default Android emulator architectures to include ARM64 to better support ARM64 on macOS.
  • Changed default Adobe AIR SDK version from 28.0 to 32.0 because 28.0 is no longer available for download from Adobe.
  • Changed minimum-sdk-version in <config:android> to customize the PLATFORM or PLATFORM_NUMBER values used by Android builds.
  • Changed index.html template to use mobile-web-app-capable instead of deprecated apple-mobile-web-app-capable.
  • Removed Linux x86_32 binaries from Haxelib (but can still rebuild them manually).
  • Removed custom implementation of haxe.io.Bytes.
  • Updated bundled HashLink executable version to 1.14.
  • Updated SDL submodule to version 2.30.12.

SWF 3.4.0 Changelog

  • Added BevelFilter and ConvolutionFilter support
  • Fixed duplicate scale9Grid graphics
  • Fixed clipping layers in OpenFL 9.5 and newer, since masks cannot be shared
  • Fixed some filter imports on Flash target
  • Fixed wrong minimum and maximum integer values used for certain comparisons
  • Fixed string formatting conversion from ActionScript to Haxe
  • Fixed swf.runtime.MovieClip exception when setting field that does not exist on some targets
15 Likes

Thank you @joshtynjala, @Dimensionscape and @singmajesty, and contributors @GeoKureli, @andresa88, @rainy, @m0rkeulv, @barisyild, @player_03 and others, for your work on this!

4 Likes

Great, a new version has been released,
However, it seems that the “swf” library has not undergone any performance optimization improvements ..

This is just wonderful!

1 Like

Cool! :smiling_face_with_three_hearts:

Where can I found more info on these?

And this looks incorrect :slight_smile: The version numbers of OpenFL and Lime are old ones

Thanks! Fixed.

1 Like

Big thanks for all this active development!

1 Like

Hello!

After update, I can’t build to android:

/usr/local/lib/haxe/lib/hxcpp/4,3,2/include/hxcpp.h:27:13: fatal error: 'typeinfo' file not found
   #include <typeinfo>
            ^~~~~~~~~~
1 error generated.
Error: Could not create PCH

I tried ndk versions 29 and 28

Please help

Have you tried with NDK 25?

Lime > Setup Android > SDK Tools

SDK Tools

In the SDK Tools tab in Android Studio’s SDK Manager, you will need to install a few items.

You should generally be able to install the newest Android SDK Build-Tools.

NDK (Side by side) version r21e (21.4.7075529) is currently recommended for Lime.

Warning: hxcpp 4.3.2 and older on Haxelib do not support newer NDKs than r21e. When the next update after hxcpp 4.3.2 is released, it should support newer NDKs (at least up to NDK version 25).

Thanks! I installed the recommended NDK version for hxcpp 4.3.2 and it seems to have helped. waiting for the build to finish…

1 Like

I highly recommend downloading a newer hxcpp from GitHub rather than using 4.3.2. There are so many bugfixes since the hxcpp 4.3.2 release from over two years ago. I honestly don’t understand why they haven’t released a new update to Haxelib in so long. It supports newer NDKs, ARM64 Mac, and probably some other big ones have all been available and stable for a while now.

You can either check it out with Git. Or download a .zip file from the releases page that you can install manually.

Sounds great! As always, thank you so much for all your hard work!

I found I needed to use the git version of hxcpp in order to cross-compile on Linux for the windows target.

@konung, to install the git version:

haxelib git hxcpp https://github.com/HaxeFoundation/hxcpp.git

You can also switch between git and release versions using haxelib set (assuming you have both installed):

For example, to set to git:

haxelib set hxcpp git

To set it to the 4.3.2 release:

haxelib set hxcpp 4.3.2
1 Like

Yes, that helped, thank you very much!

But now I’m running into another problem.
I’m using the SpriterHaxeEngine library, and it’s breaking on ScmlObject.unserializePack

Called from spriter.definitions.ScmlObject::unserializePack spriter/definitions/ScmlObject.hx line 39
Called from haxe.Unserializer::unserialize /usr/local/lib/haxe/std/haxe/Unserializer.hx line 352
Called from haxe.Unserializer::unserialize /usr/local/lib/haxe/std/haxe/Unserializer.hx line 315
Called from haxe.Unserializer::unserializeObject /usr/local/lib/haxe/std/haxe/Unserializer.hx line 200
Called from Reflect::setField /usr/local/lib/haxe/std/cpp/_std/Reflect.hx line 41
Exception: Invalid field:currentTime

I don’t know yet which side the problem is on. I have encountered this problem before SpriterHaxeEngine. Unserialization issue.

@Bink @joshtynjala

I’m continuing to test the new version on my Android game.

NativeHTTPRequest crashes the game in 80% of requests.
line 318 → new TheadPool(0, 1) → TheadPool.isMainThread() → Thread.current()

Any ideas?

Are you trying to make HTTP requests from a thread that isn’t the main one?

I only use standard methods of communication with the server myself:

loader = new URLLoader();
        loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatus);
        loader.addEventListener(Event.COMPLETE, onSuccess);
        loader.addEventListener(IOErrorEvent.IO_ERROR, onError);
        loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
        loader.load(request);

Unfortunately, I am not an expert in threads.

But do you create any new threads? Then, in one of those threads, do you use URLLoader?

I see mention of threads in some extensions I use (in JNISafety and @:runOnMainThread). I don’t use threads at all in my code.

“I added @:runOnMainThread to all callbacks in the Google Play Games extension that were followed by the first request to my server. It seems to have helped. The game hasn’t been crashing anymore.”

1 Like