Hi guys,
Just a quick question. How do I disable mouse inputs during movie playback? I want only the ESC button to skip the movie and prevent rollback.
Thanks!
Disable mouse during movie?
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.
- ktalkimist
- Veteran
- Posts: 216
- Joined: Fri Oct 19, 2012 10:28 pm
- Contact:
Re: Disable mouse during movie?
Ren'Py can be operated by mouse and by keys too. So, one can make a screen that will re-set the actions for keys and mouse buttons if shown. Like
http://www.renpy.org/wiki/renpy/doc/reference/Keymap
http://www.pygame.org/docs/ref/key.html
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/screens.html#key
Code: Select all
screen my_scr:
key "K_RETURN" action Hide("nonexistent_screen")
key "K_KP_ENTER" action Hide("nonexistent_screen")
key "K_SPACE" action Hide("nonexistent_screen")
key "mousedown_4" action Hide("nonexistent_screen")
key "K_PAGEUP" action Hide("nonexistent_screen")
key "mousedown_5" action Hide("nonexistent_screen")
key "K_PAGEDOWN" action Hide("nonexistent_screen")
key "mouseup_3" action Hide("nonexistent_screen")
key "mouseup_1" action Hide("nonexistent_screen")
key "K_ESCAPE" action Return("smth")
label start:
"Everything works like it suppose to be..."
"And now, you'll see the movie that you'll be unable to skip (exept esc-key)"
show screen my_scr
# show movie here
hide screen my_scr
http://www.pygame.org/docs/ref/key.html
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/screens.html#key
Last edited by Alex on Thu Jul 25, 2013 1:44 pm, edited 1 time in total.
- AlfieMachica123
- Regular
- Posts: 56
- Joined: Sun Jun 30, 2013 10:15 pm
- Contact:
Re: Disable mouse during movie?
thanks for the tip , i can use this but,
what about the left click for the mouse?
thanks
what about the left click for the mouse?
thanks
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Disable mouse during movie?
The left click of the mouse is covered in Alex's code. It is the mousedown_1 code up there.AlfieMachica123 wrote:thanks for the tip , i can use this but,
what about the left click for the mouse?
I can't find where the specific numbers are explained but:
mousebutton 1 = left click
mousebutton 2 = center button click
mousebutton 3 = right click
mousebutton 4 = mouse wheel up
mousebutton 5 = mouse wheel down
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
- AlfieMachica123
- Regular
- Posts: 56
- Joined: Sun Jun 30, 2013 10:15 pm
- Contact:
Re: Disable mouse during movie?
am sorry , but the mouse input left and right click still works,
i used the code he gave like this
label start:
"Everything works like it suppose to be..."
"And now, you'll see the movie that you'll be unable to skip (exept esc-key)"
show screen my_scr ## starting here should not work
"eff-er" "effidee eff eff eff" ## left and right still works here
hide screen my_scr ## this should bring back the controls, right ?
"what the heck happened" ##
return
and there..
i used the code he gave like this
label start:
"Everything works like it suppose to be..."
"And now, you'll see the movie that you'll be unable to skip (exept esc-key)"
show screen my_scr ## starting here should not work
"eff-er" "effidee eff eff eff" ## left and right still works here
hide screen my_scr ## this should bring back the controls, right ?
"what the heck happened" ##
return
and there..
Re: Disable mouse during movie?
Ooops... should be
Code: Select all
key "mouseup_3" action Hide("nonexistent_screen")
key "mouseup_1" action Hide("nonexistent_screen")
- AlfieMachica123
- Regular
- Posts: 56
- Joined: Sun Jun 30, 2013 10:15 pm
- Contact:
Re: Disable mouse during movie?
it works now, thanks a lot
Who is online
Users browsing this forum: Dark79, Google [Bot]