Is there any way to set it so that each click makes a sound? I tried a few things, but all I can seem to manage is making it so buttons make sounds, but that isn't exactly what I'm going for. Thanks!
Edit: OR, is there a way to make it so when you click to continue in the dialogue, it makes a sound?
[SOLVED] Sound on Click?
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.
[SOLVED] Sound on Click?
Last edited by 4listair on Wed Sep 05, 2018 4:23 pm, edited 1 time in total.
- dGameBoy101b
- Regular
- Posts: 31
- Joined: Sun Aug 12, 2018 8:32 am
- itch: dgameboy101b
- Contact:
Re: Sound on Click?
You can create a screen that has an invisible image button over the whole display and uses a Play() action to play an audio file whenever the player clicks or presses a button to advance the dialogue.
Code: Select all
init:
transform FullScreen():
python:
x = renpy.get_physical_size()[0]
y = renpy.get_physical_size()[1]
align(0.0,0.0)
size(x,y)
screen ClickSound():
modal False
python:
keys = config.keymap["dismiss"]
imagebutton:
idle "null.png" at FullScreen #null.png is a transparent image
action Play("sound","click.ogg") #click.ogg is the sound you want played
keysym keys
start:
show screen ClickSound
"I like to make sounds when you click!"
- MaydohMaydoh
- Regular
- Posts: 165
- Joined: Mon Jul 09, 2018 5:49 am
- Projects: Fuwa Fuwa Panic
- Tumblr: maydohmaydoh
- Location: The Satellite of Love
- Contact:
Re: Sound on Click?
To simplify that button code, all you need is:dGameBoy101b wrote: ↑Sat Aug 18, 2018 7:23 am You can create a screen that has an invisible image button over the whole display and uses a Play() action to play an audio file whenever the player clicks or presses a button to advance the dialogue.Code: Select all
init: transform FullScreen(): python: x = renpy.get_physical_size()[0] y = renpy.get_physical_size()[1] align(0.0,0.0) size(x,y) screen ClickSound(): modal False python: keys = config.keymap["dismiss"] imagebutton: idle "null.png" at FullScreen #null.png is a transparent image action Play("sound","click.ogg") #click.ogg is the sound you want played keysym keys start: show screen ClickSound "I like to make sounds when you click!"
Code: Select all
screen ClickSound():
button:
background None ## Makes button invisible
xfill True yfill True ## Automatically makes button same size as window
action Play('sound', 'click.ogg')
keysym 'dismiss' ## Give the dismiss keys directly to keysym
A different method would be to just play a sound each time the say screen is hidden, which it does every time you click to continue and advance the text.
Code: Select all
screen say(who, what):
if not config.skipping and what: ## Stop sound playing when skipping
on 'hide' action Play('sound', 'click.ogg') ## Play sound when say screen is hidden
Code: Select all
screen ctc(arg=None):
if not config.skipping:
on 'hide' action Play('sound', 'click.ogg')
- 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: Sound on Click?
Alternatively (though this is not fully tested)
Code: Select all
init python:
config.underlay.append(
renpy.Keymap(
mousedown_1 = lambda: renpy.run( renpy.play("audio/auto/default/completion_7_meghan.ogg") ) # rename the file as needed
)
)
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: Sound on Click?
All of your guys' solutions were wayy less complicated than what I'd come up with... Damn. Many thanks!
Who is online
Users browsing this forum: No registered users