Hi everyone, thanks for taking the time to help me out
So I have an issue where I'm calling a screen that has a timer and a imagebutton.
The timer works, but there's an issue with the imagebutton where the hover animation and sound effect don't work. But the button still works when I click it.
Pretty sure there's nothing wrong with the code as I'm not getting any error messages. And I made sure that the images and sound effects are inside my game folder too.
Is there a limit in the engine to how much things I can have going on at once while calling a screen?
Hover animation and sound doesn't activate when using timer function
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.
Hover animation and sound doesn't activate when using timer function
- Attachments
-
- Screenshot 2023-11-20 183941.png (42.34 KiB) Viewed 5294 times
- m_from_space
- Eileen-Class Veteran
- Posts: 1198
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Hover animation and sound doesn't activate when using timer function
I remember cases here in this forum where people wondered why their sound effects or music don't work. Turned out the files were corrupted. Have you tried playing them with any normal music player like VLC?
I'm not sure which channel Renpy uses for those effects (I hope "audio", so everything can be parallel), but are you by any chance playing ongoing music/sound on the "sound" channel while you try this (instead of the "music" channel for example)?
If that's all working and okay, could you try writing:
Code: Select all
hover_sound audio.select_effect_2
activate_sound audio.back_effect
Also which version of Renpy are you using? Please update to the latest "nightly fix" (not nightly) via the update button!
Is there a specific reason you're asking this? Are there thousands of things inside your screens at the same time or anything?Is there a limit in the engine to how much things I can have going on at once while calling a screen?
Re: Hover animation and sound doesn't activate when using timer function
I checked the audio files using a music player, but they are fine.
I don't have any ongoing music or sound playing either.
I tried using the code you gave me, but I got the same result.
The nightly update didn't seem to help either...
Here's an image of the entire screen code:
I don't have any ongoing music or sound playing either.
I tried using the code you gave me, but I got the same result.
The nightly update didn't seem to help either...
Here's an image of the entire screen code:
- Attachments
-
- Screenshot 2023-11-21 101740.png
- (98.97 KiB) Not downloaded yet
- m_from_space
- Eileen-Class Veteran
- Posts: 1198
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Hover animation and sound doesn't activate when using timer function
Looking at this code, my assumption is that your non-working imagebutton is blocked by something you draw later inside the screen, most likely the frame. Or maybe another screen that's in front of it. Because in that case you cannot actually hover it, meaning no event fires. Is that possible? Could you move it after the frame?
On the other hand you wrote that you are able to click it, so I don't really know.
- m_from_space
- Eileen-Class Veteran
- Posts: 1198
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Hover animation and sound doesn't activate when using timer function
I just realized that you have timers active that are called repeatedly every 0.01 seconds. That most probably is a bad idea and maybe leads to Renpy not being able to process the hover events. But that's just an assumption right now. You should try counting in seconds, not milliseconds.
Re: Hover animation and sound doesn't activate when using timer function
Yeah, that's probably it. I just tried taking out the timer and the imagebutton works as it should.
edit: That fixed it! Thanks for helping me out
edit: That fixed it! Thanks for helping me out
Who is online
Users browsing this forum: Google [Bot]