EDIT: Just use hovered & unhovered along with Show & Hide, with transition=Dissolve(0.5) .... It's reliable and works 100% on mobile, tablet and pc.
____________________________________________________________
(I was going to submit this bug to github, but there's a small chance it might be user error, and I'd hate to waste Renpytom's time.)
When you mouse over the textbutton, the fade in works, but when you unhover the textbutton, the fade out never occurs, or maybe it does, but it gets canceled. Is this a bug or expected behavior? I was expecting the fade out to occur and finish when the mouse unhovers from the textbutton.
How to reproduce:
1. Replace script.rpy with the following code below.
2. Start new game.
3. Mouse over either textbutton. The **_on appear_** triggers correctly, the frame fades in.
4. When you unhover the mouse, the **_on hide_** never triggers, fade out never occurs.
5. Use the keyboard arrow keys to focus a textbutton. The **_on appear_** triggers correctly, the frame fades in.
6. Use the keyboard arrow to move to the next textbutton. The **_on hide_** triggers correctly, the frame shown from previous button fades out.
7. Use the keyboard arrow keys to make both textbutton's lose focus by moving up, the on hide does not trigger, the fade out does not occur.
8. Move back & forth between each textbutton using the arrow keys on keyboard, the transform events function correctly.
9. Once again use the mouse to hover over each textbutton, the on appear works, but when you unhover, the on hide event of the transform never triggers for some reason.
Maybe I'm doing something wrong?
Code: Select all
label start:
show screen yo
'test'
return
screen yo():
textbutton "123":
tooltip '123'
xpos 500
ypos 500
action NullAction()
textbutton "abc":
tooltip 'abc'
xpos 400
ypos 400
action NullAction()
use sometooltip
screen sometooltip():
$ toolTip = GetTooltip()
if toolTip is not None:
showif toolTip == '123':
use an_img_with_text1
elif toolTip == 'abc':
use an_img_with_text2
screen an_img_with_text1():
add 'gui/frame.png' at transform_fade_in_out
text 'text1'
screen an_img_with_text2():
add 'gui/frame.png' xpos 800 ypos 800 at transform_fade_in_out
text 'text2'
transform transform_fade_in_out():
on appear:
alpha 0.0
easein 1.0 alpha 1.0
on show:
alpha 0.0
easein 1.0 alpha 1.0
on hide:
alpha 1.0
easein 1.0 alpha 0.0