Module: Yuki::Animation
- Defined in:
- docs/4_Systems_005_Animation.rb
Overview
Module containing all the animation utility
Defined Under Namespace
Classes: AudioCommand, Command, Dim2Animation, Dim2AnimationDiscreet, DiscreetAnimation, FullyResolvedAnimation, Handler, MessageLocked, MoveSpritePosition, ResolverObjectCommand, ScalarAnimation, ScalarOffsetAnimation, SignalWaiter, SpriteCreationCommand, SpriteSheetAnimation, TimedAnimation, TimedCommands, TimedLoopAnimation
Constant Summary collapse
- DISTORTIONS =
Hash describing all the distrotion procs
{SMOOTH_DISTORTION: proc { |x| 1 - Math.cos(pi_div2 * x ** 1.5) ** 5 }, UNICITY_DISTORTION: proc { |x| x }, SQUARE010_DISTORTION: proc { |x| 1 - (x * 2 - 1) ** 2 }, SIN: proc { |x| Math.sin(2 * Math::PI * x) }}
- TIME_SOURCES =
Hash describing all the time sources
{GENERIC_TIME_SOURCE: Graphics.method(:current_time)}
- DEFAULT_RESOLVER =
Default object resolver (make the game crash)
proc { |x| raise "Couldn't resolve object :#{x}" }
Class Method Summary collapse
-
.bgm_play(filename, volume = 100, pitch = 100)
Play a BGM.
-
.bgm_stop
Stop the bgm.
-
.bgs_play(filename, volume = 100, pitch = 100)
Play a BGS.
-
.bgs_stop
Stop the bgs.
-
.cell_x_change(during, on, cell_start, cell_end, width, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a src_rect.x animation convert it to another number (between 0 & 1) in order to distord time.
-
.cell_y_change(during, on, cell_start, cell_end, width, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a src_rect.y animation convert it to another number (between 0 & 1) in order to distord time.
-
.create_sprite(viewport, name, type, args = nil, *properties)
Create a new sprite.
-
.dispose_sprite(name)
Dispose a sprite.
-
.me_play(filename, volume = 100, pitch = 100)
Play a ME.
-
.message_locked_animation
Function that creates a message locked animation.
-
.move(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a move animation (from a to b) convert it to another number (between 0 & 1) in order to distord time.
-
.move_discreet(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a move animation (from a to b) with discreet values (Integer) convert it to another number (between 0 & 1) in order to distord time.
-
.move_sprite_position(time_to_process, on, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) ⇒ MoveSpritePosition
Create a new ScalarAnimation convert it to another number (between 0 & 1) in order to distord time.
-
.opacity_change(during, on, opacity_start, opacity_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a opacity animation convert it to another number (between 0 & 1) in order to distord time.
-
.resolved ⇒ FullyResolvedAnimation
Create a fully resolved animation.
-
.rotation(during, on, angle_start, angle_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a rotation animation convert it to another number (between 0 & 1) in order to distord time.
-
.run_commands_during(duration, *animation_commands)
Try to run commands during a specific duration and giving a fair repartition of the duraction for each commands.
-
.scalar(time_to_process, on, property, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a scalar animation convert it to another number (between 0 & 1) in order to distord time.
-
.scalar_offset(time_to_process, on, property_get, property_set, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) ⇒ ScalarOffsetAnimation
Create a new ScalarOffsetAnimation.
-
.se_play(filename, volume = 100, pitch = 100)
Play a SE.
-
.send_command_to(name, command, *args)
Send a command to an object in the resolver.
-
.shift(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a origin pixel shift animation (from a to b inside the bitmap) convert it to another number (between 0 & 1) in order to distord time.
-
.timed_loop_animation(time_to_process, distortion = :UNICITY_DISTORTION, time_source = :GENERIC_TIME_SOURCE)
Create a new TimedLoopAnimation convert it to another number (between 0 & 1) in order to distord time.
-
.wait(during, time_source: :GENERIC_TIME_SOURCE)
Create a “wait” animation.
-
.wait_signal(name = nil, *args, &block) ⇒ SignalWaiter
Create a new SignalWaiter animation.
Class Method Details
.bgm_play(filename, volume = 100, pitch = 100)
Play a BGM
389 390 |
# File 'docs/4_Systems_005_Animation.rb', line 389 def bgm_play(filename, volume = 100, pitch = 100) end |
.bgm_stop
Stop the bgm
392 393 |
# File 'docs/4_Systems_005_Animation.rb', line 392 def bgm_stop end |
.bgs_play(filename, volume = 100, pitch = 100)
Play a BGS
398 399 |
# File 'docs/4_Systems_005_Animation.rb', line 398 def bgs_play(filename, volume = 100, pitch = 100) end |
.bgs_stop
Stop the bgs
401 402 |
# File 'docs/4_Systems_005_Animation.rb', line 401 def bgs_stop end |
.cell_x_change(during, on, cell_start, cell_end, width, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a src_rect.x animation convert it to another number (between 0 & 1) in order to distord time
272 273 |
# File 'docs/4_Systems_005_Animation.rb', line 272 def cell_x_change(during, on, cell_start, cell_end, width, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.cell_y_change(during, on, cell_start, cell_end, width, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a src_rect.y animation convert it to another number (between 0 & 1) in order to distord time
283 284 |
# File 'docs/4_Systems_005_Animation.rb', line 283 def cell_y_change(during, on, cell_start, cell_end, width, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.create_sprite(viewport, name, type, args = nil, *properties)
Create a new sprite
437 438 |
# File 'docs/4_Systems_005_Animation.rb', line 437 def create_sprite(, name, type, args = nil, *properties) end |
.dispose_sprite(name)
Dispose a sprite
466 467 |
# File 'docs/4_Systems_005_Animation.rb', line 466 def dispose_sprite(name) end |
.me_play(filename, volume = 100, pitch = 100)
Play a ME
407 408 |
# File 'docs/4_Systems_005_Animation.rb', line 407 def me_play(filename, volume = 100, pitch = 100) end |
.message_locked_animation
Function that creates a message locked animation
525 526 |
# File 'docs/4_Systems_005_Animation.rb', line 525 def end |
.move(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a move animation (from a to b) convert it to another number (between 0 & 1) in order to distord time
212 213 |
# File 'docs/4_Systems_005_Animation.rb', line 212 def move(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.move_discreet(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a move animation (from a to b) with discreet values (Integer) convert it to another number (between 0 & 1) in order to distord time
224 225 |
# File 'docs/4_Systems_005_Animation.rb', line 224 def move_discreet(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.move_sprite_position(time_to_process, on, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) ⇒ MoveSpritePosition
Create a new ScalarAnimation convert it to another number (between 0 & 1) in order to distord time
575 576 |
# File 'docs/4_Systems_005_Animation.rb', line 575 def move_sprite_position(time_to_process, on, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.opacity_change(during, on, opacity_start, opacity_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a opacity animation convert it to another number (between 0 & 1) in order to distord time
142 143 |
# File 'docs/4_Systems_005_Animation.rb', line 142 def opacity_change(during, on, opacity_start, opacity_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.resolved ⇒ FullyResolvedAnimation
Create a fully resolved animation
618 619 |
# File 'docs/4_Systems_005_Animation.rb', line 618 def resolved end |
.rotation(during, on, angle_start, angle_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a rotation animation convert it to another number (between 0 & 1) in order to distord time
132 133 |
# File 'docs/4_Systems_005_Animation.rb', line 132 def rotation(during, on, angle_start, angle_end, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.run_commands_during(duration, *animation_commands)
Never put dispose command inside this command, there’s risk that it does not execute
Try to run commands during a specific duration and giving a fair repartition of the duraction for each commands
489 490 |
# File 'docs/4_Systems_005_Animation.rb', line 489 def run_commands_during(duration, *animation_commands) end |
.scalar(time_to_process, on, property, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a scalar animation convert it to another number (between 0 & 1) in order to distord time
153 154 |
# File 'docs/4_Systems_005_Animation.rb', line 153 def scalar(time_to_process, on, property, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.scalar_offset(time_to_process, on, property_get, property_set, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) ⇒ ScalarOffsetAnimation
Create a new ScalarOffsetAnimation
200 201 |
# File 'docs/4_Systems_005_Animation.rb', line 200 def scalar_offset(time_to_process, on, property_get, property_set, a, b, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.se_play(filename, volume = 100, pitch = 100)
Play a SE
413 414 |
# File 'docs/4_Systems_005_Animation.rb', line 413 def se_play(filename, volume = 100, pitch = 100) end |
.send_command_to(name, command, *args)
Send a command to an object in the resolver
462 463 |
# File 'docs/4_Systems_005_Animation.rb', line 462 def send_command_to(name, command, *args) end |
.shift(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE)
Create a origin pixel shift animation (from a to b inside the bitmap) convert it to another number (between 0 & 1) in order to distord time
236 237 |
# File 'docs/4_Systems_005_Animation.rb', line 236 def shift(during, on, start_x, start_y, end_x, end_y, distortion: :UNICITY_DISTORTION, time_source: :GENERIC_TIME_SOURCE) end |
.timed_loop_animation(time_to_process, distortion = :UNICITY_DISTORTION, time_source = :GENERIC_TIME_SOURCE)
Create a new TimedLoopAnimation convert it to another number (between 0 & 1) in order to distord time
582 583 |
# File 'docs/4_Systems_005_Animation.rb', line 582 def timed_loop_animation(time_to_process, distortion = :UNICITY_DISTORTION, time_source = :GENERIC_TIME_SOURCE) end |
.wait(during, time_source: :GENERIC_TIME_SOURCE)
Create a “wait” animation
15 16 |
# File 'docs/4_Systems_005_Animation.rb', line 15 def wait(during, time_source: :GENERIC_TIME_SOURCE) end |
.wait_signal(name = nil, *args, &block) ⇒ SignalWaiter
Create a new SignalWaiter animation
648 649 |
# File 'docs/4_Systems_005_Animation.rb', line 648 def wait_signal(name = nil, *args, &block) end |