Class: Yuki::Animation::AudioCommand
- Inherits:
-
Command
- Object
- TimedAnimation
- Command
- Yuki::Animation::AudioCommand
- Defined in:
- scripts/01100 Yuki/00100 Animation/00101 Commands.rb
Overview
Animation command responsive of playing / stopping audio. It sends the type command to Audio with *args as parameter.
Example: Playing a SE
AudioCommand.new(:se_play, 'audio/se/filename', 80, 80)
Instance Attribute Summary
Attributes inherited from TimedAnimation
#begin_time, #end_time, #parallel_animations, #root, #sub_animation, #time_source
Instance Method Summary collapse
-
#initialize(type, *args) ⇒ AudioCommand
constructor
Create a new AudioCommand.
Methods inherited from Command
Methods inherited from TimedAnimation
#done?, #in_parallel_of, #parallel_add, #play_before, #resolver=, #start, #update
Constructor Details
#initialize(type, *args) ⇒ AudioCommand
Create a new AudioCommand
113 114 115 116 117 118 119 |
# File 'scripts/01100 Yuki/00100 Animation/00101 Commands.rb', line 113 def initialize(type, *args) super() @type = type @args = args @args.each_with_index { |arg, i| @args[i] = resolve(arg) } @args[0] &&= 'Audio/' + @type.to_s.sub('_play', '') + '/' + @args.first end |