-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation for audio and interface classes (#167)
* Finish documentation for some audio classes Finished PopochiuAudioCue, AudioCueSound and AudioCueMusic. * Progress on AudioManager documentation Minor updates to PopochiuAudioCue documentation. [upd] Removed preload of audio_cue.gd to use PopochiuAudioCue directly in AudioManager class. * Finish documentation for AudioManager Improved grammar in all documentation comments for audio classes. [upd] Minor style update for comment about queue methods. * Add documentation for IAudio, ICharacter and IDialog Minor updates to documentation in PopochiuCharacter and Popochiu. [upd] Now semitone_to_pitch in PopochiuAudioManager is a private method. * Finish documentation for IDialog and IInventory Create PopochiuIInventory class. [upd] Minor updates for PopochiuInventoryItem * Finish documentation for PopochiuIRoom Update long description styles for PopochiuICharacter, PopochiuIDialog, PopochiuIInventory. [fix] Fix old calls to I.set_active_item() * Finish documentation for PopochiuIGraphicInterface
- Loading branch information
Showing
20 changed files
with
684 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
@tool | ||
extends PopochiuAudioCue | ||
class_name AudioCueMusic | ||
extends PopochiuAudioCue | ||
## A specific type of [PopochiuAudioCue] designed for playing music. | ||
|
||
|
||
# ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ PUBLIC ░░░░ | ||
# Plays immediately this cue's music track. | ||
# It can fade for `fade_duration` seconds. | ||
# You can change the track starting position in seconds with `music_position`. | ||
#region Public ##################################################################################### | ||
## Plays this audio cue. It can fade for [param fade_duration] seconds, and you can change the track | ||
## starting position in seconds with [param music_position]. | ||
func play(fade_duration := 0.0, music_position := 0.0) -> void: | ||
E.am.play_music_cue(resource_name, fade_duration, music_position) | ||
|
||
|
||
# Queue the call to play this cue's music track. | ||
# It can fade for `fade_duration` seconds. | ||
# You can change the track starting position in seconds with `music_position`. | ||
# (!) This is intended to run in queued instructions: E.queue([]). | ||
## Plays this audio cue. It can fade for [param fade_duration] seconds, and you can change the track | ||
## starting position in seconds with [param music_position].[br][br] | ||
## [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i] | ||
func queue_play(fade_duration := 0.0, music_position := 0.0) -> Callable: | ||
return func (): | ||
await play(fade_duration, music_position) | ||
await E.get_tree().process_frame | ||
|
||
|
||
#endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
@tool | ||
extends PopochiuAudioCue | ||
class_name AudioCueSound | ||
extends PopochiuAudioCue | ||
## A specific type of [PopochiuAudioCue] designed for playing sounds. | ||
|
||
|
||
# ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ PUBLIC ░░░░ | ||
# Plays immediately this cue's sound. | ||
# If `wait_to_end` is `true` the function will pause until the audio clip finishes. | ||
# You can play the clip from a specific `position_2d` in the scene if `is_2d` is | ||
# `true`. | ||
#region Public ##################################################################################### | ||
## Plays this audio cue. If [param wait_to_end] is set to [code]true[/code], the function will pause | ||
## until the audio clip finishes. You can play the file from a specific [param position_2d] in the | ||
## scene if [member PopochiuAudioCue.is_2d] is [code]true[/code]. | ||
func play(wait_to_end := false, position_2d := Vector2.ZERO) -> void: | ||
if wait_to_end: | ||
await E.am.play_sound_cue(resource_name, position_2d, true) | ||
else: | ||
E.am.play_sound_cue(resource_name, position_2d) | ||
|
||
|
||
# Queue the call to play this cue's sound. | ||
# If `wait_to_end` is `true` the function will pause until the audio clip finishes | ||
# You can play the clip from a specific `position_2d` in the scene if `is_2d` is | ||
# `true`. | ||
# (!) This is intended to be used in queued instructions: E.queue([]). | ||
## Plays this audio cue. If [param wait_to_end] is set to [code]true[/code], the function will pause | ||
## until the audio clip finishes. You can play the file from a specific [param position_2d] in the | ||
## scene if [member PopochiuAudioCue.is_2d] is [code]true[/code].[br][br] | ||
## [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i] | ||
func queue_play(wait_to_end := false, position_2d := Vector2.ZERO) -> Callable: | ||
return func (): | ||
if wait_to_end: | ||
await play(true, position_2d) | ||
else: | ||
play(false, position_2d) | ||
await E.get_tree().process_frame | ||
|
||
|
||
#endregion |
Oops, something went wrong.