Android and focus_mask True
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.
Android and focus_mask True
Hello! Tell me, please, does the "focus_mask True" property of the imagebuttons work in the latest versions of RenPy when porting the project to the Android?
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: Android and focus_mask True
Nope. It's a limit of the Android hardware.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Android and focus_mask True
Thanks for the answer. It's a pity.
Are there any adequate ways to circumvent this restriction? The basic part of my project is based on the exact location of active objects on the screen, the easiest way to do this is to use imagebuttons and focus_mask.
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: Android and focus_mask True
Not at this time. I might revisit this in the next few months, but for now it's pretty fundamental.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Android and focus_mask True
I am not entirely sure if this would work... You could set the focus_mask to a python function that took the x,y and evaluated a True/False response based upon math rather than the transparent pixels...
For 'simple' example, if you had a round button, def active_area(x,y): return (x-radius)^2+(y-radius)^2<=radius^2 sort of thing
focus_mask = callable
If a non-displayable callable (like a function, method, or object with a __call__ method) is given, the function is called with two arguments, the x and y offset from the top-left corner of the displayable. If the function returns true, the displayable is focused.
Note: This still wouldn't fix any issues with Android properly displaying the transparencies in the buttons (if that still happens). It would only change which pixels are considered 'active' for hover/click etc
For 'simple' example, if you had a round button, def active_area(x,y): return (x-radius)^2+(y-radius)^2<=radius^2 sort of thing
focus_mask = callable
If a non-displayable callable (like a function, method, or object with a __call__ method) is given, the function is called with two arguments, the x and y offset from the top-left corner of the displayable. If the function returns true, the displayable is focused.
Note: This still wouldn't fix any issues with Android properly displaying the transparencies in the buttons (if that still happens). It would only change which pixels are considered 'active' for hover/click etc
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: Android and focus_mask True
Oh, then there is hope. Thank you! I will very much wait for this.
Thanks, I'll try it. But, of course, would like a more obvious and easy solution.
Who is online
Users browsing this forum: Hojoo