Module: Yuki::Animation
- Defined in:
- scripts/01100 Yuki/00100 Animation/00100 Animation.rb,
scripts/01100 Yuki/00100 Animation/00103 Handler.rb,
scripts/01100 Yuki/00100 Animation/00101 Commands.rb,
scripts/01100 Yuki/00100 Animation/00105 SignalWaiter.rb,
scripts/01100 Yuki/00100 Animation/00102 MessageLocked.rb,
scripts/01100 Yuki/00100 Animation/00104 MoveAnimationHelper.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
{ # Proc defining the SMOOTH Time distortion SMOOTH_DISTORTION: proc { |x| 1 - Math.cos(pi_div2 * x**1.5)**5 }, # Proc defining the UNICITY Time distortion (no distortion at all) UNICITY_DISTORTION: proc { |x| x }, # Proc defining the SQUARE 0 to 1 to 0 distortion SQUARE010_DISTORTION: proc { |x| 1 - (x * 2 - 1)**2 } }
- TIME_SOURCES =
Hash describing all the time sources
{ # Generic time source (callable object that gives the current time) GENERIC_TIME_SOURCE: Graphics.method(:current_time) # Time.method(:now) }
- 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.
-
.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
.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)
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
.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
.wait(during, time_source: :GENERIC_TIME_SOURCE)
Create a “wait” animation
.wait_signal(name = nil, *args, &block) ⇒ SignalWaiter
Create a new SignalWaiter animation