I’ll try to write something tonight.
What do you mean by ‘extend the UI with a custom display function’ ?
you know you can create your own module and then in config.lua or main.lua do:
display.yourCustomFunction = yourCustomModule.function
Is this more or less what you are looking for?
If you want a quick solution, and create a new module in native, here’s a sample code I use to check if ad tracking is disabled/enabled on ios [will add something for Android later on].
Edit your AppCoronaDelegate.mm file in your project:
#import \<AdSupport/ASIdentifierManager.h\> @implementation AppCoronaDelegate // [lua=auto:0] cluain.checkAdTracking() static int checkAdTracking( lua\_State \*L ) { ASIdentifierManager \*adIdentManager = [ASIdentifierManager sharedManager]; if (adIdentManager.advertisingTrackingEnabled) { lua\_pushboolean(L, true); } else { lua\_pushboolean(L, false); } return 1; } - (void)willLoadMain:(id\<CoronaRuntime\>)runtime { lua\_State \*L = runtime.L; const luaL\_Reg kFunctions[] = { "isAdTrackingEnabled", checkAdTracking, NULL, NULL }; luaL\_register( L, "cluain", kFunctions ); lua\_pop( L, 1 ); }
With this you will be able to access cluain.isAdTrackingEnabled() function in your lua code.
Krystian