There's a real time clock on my game (for mobile).
I was wondering if I could also import and show the phone's charge percentage like that (the 49%):
So that the person can be aware of the status.
I'm not sure if Renpy can do that.
Thanks
[solved] Is it possible to import and show the battery percentage of your phone?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
[solved] Is it possible to import and show the battery percentage of your phone?
Last edited by Nanahs on Thu Nov 08, 2018 9:42 pm, edited 1 time in total.
- PyTom
- Ren'Py Creator
- Posts: 16088
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Is it possible to import and show the battery percentage of your phone?
You can get it using:
Code: Select all
pygame_sdl2.power.get_power_info().percent
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Is it possible to import and show the battery percentage of your phone?
Thank you so much! I couldn't make it work (cause I'm still learning what those things mean and how to place them hah). But thank you anyway. I'll study morePyTom wrote: ↑Sun Oct 07, 2018 2:28 pm You can get it using:
Code: Select all
pygame_sdl2.power.get_power_info().percent
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3785
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Is it possible to import and show the battery percentage of your phone?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Is it possible to import and show the battery percentage of your phone?
Oh! Thank you so much! This is exactly what I was looking for. Thanks for sharing
Who is online
Users browsing this forum: Ahrefs [Bot]