OpenFl embedded within an Objective-C iOS app

I have an OpenFL game that I need to embed within an Objective-C application.

The GUI is in Objective-C and the openFL game will be ‘underneath’ that GUI.

I’ve seen other posts on this subject:
here and
here in which singmajesty writes

Technically, you can modify the surrounding template for these platforms however you want

What is this template that is referred to and how does it need to be modified? I assume the resulting OpenFL binary will be a library that is then compiled into the Objective-C code.

The OpenFl game would need to be initialized with a reference to the Objective-C application’s ‘Stage’ so that the openFl game would be visible. And the game’s control API would need to be exposed to the Objective-C application so that changes made via the UI would take effect in the game.

Any clues or samples as to how this could be achieved?

(My first thought was to just write the UI in haxeUI or similar, but my boss wants the ‘Native UI’ that is available in Objective-C)

Jake

First question, do you use OpenFL legacy, or the current OpenFL? How it works with iOS is quite different between the two. Thanks!

Thank you for your response. I’m using current OpenFL, not the legacy build.

Is the template you’re referring to one of those in
\HaxeToolkit\haxe\lib\lime\2,7,0\templates\iphone ?

Okay. I’m sorry for the delay!

In the current OpenFL and Lime versions, we have SDL as our current default backend for iOS, Android and desktop. There might be a way to embed SDL applications within standard iOS applications, or to just go ahead and tweak the default wrapper that SDL uses.

Another option, Lime is designed to handle multiple backends. It would be possible to do something that uses a fully custom GL surface, but to ditch SDL entirely, and just create the low-level wiring needed.

Either option is essentially open, whatever seems to be the better fit. The SDL submodule might be modified to live in a larger application, you might be able to use something custom, and to just pump the correct mouse, touch and application events up, and OpenFL won’t know the difference

Happy to help answer any more questions

Thank you for the pointers - I’ll explore.
Regards, Jake