Android and focus_mask True

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Android and focus_mask True

#1 Post by Morok D » Sat Feb 10, 2018 8:13 am

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?

User avatar
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

#2 Post by PyTom » Sat Feb 10, 2018 12:11 pm

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Re: Android and focus_mask True

#3 Post by Morok D » Sat Feb 10, 2018 12:56 pm

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.

User avatar
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

#4 Post by PyTom » Sat Feb 10, 2018 12:58 pm

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
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
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

#5 Post by Remix » Sat Feb 10, 2018 1:25 pm

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
Frameworks & Scriptlets:

Morok D
Regular
Posts: 25
Joined: Fri Mar 25, 2016 9:24 am
Contact:

Re: Android and focus_mask True

#6 Post by Morok D » Sat Feb 10, 2018 1:30 pm

PyTom wrote:
Sat Feb 10, 2018 12:58 pm
Not at this time. I might revisit this in the next few months, but for now it's pretty fundamental.
Oh, then there is hope. Thank you! I will very much wait for this.
Remix wrote:
Sat Feb 10, 2018 1:25 pm
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...
Thanks, I'll try it. But, of course, would like a more obvious and easy solution. :)

Post Reply

Who is online

Users browsing this forum: Hojoo