Skip to content

DisplayManager.BacklightProvider

Inherits: RefCounted

Interface for controlling backlights (e.g. screen brightness)

Methods

Returns Signature
PackedStringArray get_backlights()
int get_max_brightness_value(_backlight: String = "")
int get_brightness_value(_backlight: String = "")
float get_brightness(_backlight: String = "")
int set_brightness(_value: float, _type: int = 0, _backlight: String = "")

Method Descriptions

get_backlights()

PackedStringArray get_backlights()

Returns all available backlights

get_max_brightness_value()

int get_max_brightness_value(_backlight: String = "")

Returns the maximum raw brightness value of the given backlight. If No backlight is passed, then this should return the value for the "main" display. Returns -1 if there is an error fetching the value.

get_brightness_value()

int get_brightness_value(_backlight: String = "")

Returns the current raw brightness value of the given backlight. If no backlight is passed, then this should return the value for the "main" display. Returns -1 if there is an error fetching the value.

get_brightness()

float get_brightness(_backlight: String = "")

Returns the current brightness level for the given backlight as a percent. Returns -1 if there is an error fetching the value

set_brightness()

int set_brightness(_value: float, _type: int = 0, _backlight: String = "")

Sets the brightness for the given backlight to the given value as a percentage (e.g. 1.0 is 100% brightness). If no backlight is specified, this should set the value on all discovered backlights. Returns OK if set successfully.