Right now, I have a camera button on screen that you click to take a screenshot. It has a hover style (the button turns yellow) and a tooltip that shows up underneath when you hover it. Unfortunately these hover elements also show up in all the screenshots and it looks pretty dumb!
What I would like is for those hover styles to work... until the user clicks to take a screenshot. There's got to be something I'm misunderstanding though, because no matter how I try to unset the styles or even just hide the quickmenu screen during the screenshot (just to see if that would work), take_screenshot() always captures the screen while the button is focused.
When I wrap the screenshot functionality in a conditional, like
Code: Select all
renpy.hide_screen("topbar")
if not renpy.get_screen("topbar"):
renpy.take_screenshot((1280, 720))
photo = renpy.game.interface.get_screenshot()
Code: Select all
button = renpy.display.focus.get_focused()
renpy.hide_screen("topbar")
enpy.display.focus.clear_focus() #???
renpy.restart_interaction() #?????????????
if renpy.display.focus.get_focused != button:
renpy.take_screenshot((1280, 720))
photo = renpy.game.interface.get_screenshot()
What do I have to do to unfocus the button during the screenshot?