Tip: dim the screen on iOS (change brightness)

static int dimScreen( lua\_State \*L ) { UIScreen \*mainScreen = [UIScreen mainScreen]; mainScreen.brightness = .5; //should set the brightness at 50% return 0; } static int undimScreen( lua\_State \*L ) { UIScreen \*mainScreen = [UIScreen mainScreen]; mainScreen.brightness = 1; //should set the brightness at 100% return 0; }

You could also shorten this to one function of course.

static int setScreenBrightness( lua\_State \*L ) float brightness = luaL\_checknumber( L, 1 ); UIScreen \*mainScreen = [UIScreen mainScreen]; mainScreen.brightness = brightness; return 0; }

Nice shortcut thanks :slight_smile:

You could also shorten this to one function of course.

static int setScreenBrightness( lua\_State \*L ) float brightness = luaL\_checknumber( L, 1 ); UIScreen \*mainScreen = [UIScreen mainScreen]; mainScreen.brightness = brightness; return 0; }

Nice shortcut thanks :slight_smile: