Get Battery Percentage (OS) #8692
Replies: 5 comments 6 replies
|
This was attempted a while ago, but was removed because the implementation was never completed. That said, the Web platform has also removed its battery status API (as it could be used to fingerprint users, leading to privacy issues). This means an implementation in Godot wouldn't be able to work in web exports. |
|
Getting the power status and percentage sounds pretty useful, especially for mobile games, which may want to account for it without user intervention. Never had a chance to use the methods in 3.x, but I always thought their existence was neat. |
|
This would be useful for mobile to display it to users for an always on display kind of app for instance. |
|
Having these methods seems useful to me, and I can confirm that it can be implemented on Android too. |
|
iOS - https://developer.apple.com/documentation/uikit/uidevice/batterystate-swift.property?language=objc So it should be possible to implement on all platforms. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was once a function like this - OS.get_power_percent_left()
I dont know why it was removed but I would like to request the following functions:
OS.get_battery_percent()
OS.get_battery_status()
With status "-1" = stationary PC, "0" = not connected, "1" = charging.
I have a Windows implementation that looks like this:
All reactions