Module: Yuki::Animation
- Defined in:
- docs/01500_Yuki.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 }}
- 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
1360 1361 |
# File 'docs/01500_Yuki.rb', line 1360 def bgm_play(filename, volume = 100, pitch = 100) end |
.bgm_stop
Stop the bgm
1363 1364 |
# File 'docs/01500_Yuki.rb', line 1363 def bgm_stop end |
.bgs_play(filename, volume = 100, pitch = 100)
Play a BGS
1369 1370 |
# File 'docs/01500_Yuki.rb', line 1369 def bgs_play(filename, volume = 100, pitch = 100) end |
.bgs_stop
Stop the bgs
1372 1373 |
# File 'docs/01500_Yuki.rb', line 1372 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
1243 1244 |
# File 'docs/01500_Yuki.rb', line 1243 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
1254 1255 |
# File 'docs/01500_Yuki.rb', line 1254 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
1408 1409 |
# File 'docs/01500_Yuki.rb', line 1408 def create_sprite(, name, type, args = nil, *properties) end |
.dispose_sprite(name)
Dispose a sprite
1437 1438 |
# File 'docs/01500_Yuki.rb', line 1437 def dispose_sprite(name) end |
.me_play(filename, volume = 100, pitch = 100)
Play a ME
1378 1379 |
# File 'docs/01500_Yuki.rb', line 1378 def me_play(filename, volume = 100, pitch = 100) end |
.message_locked_animation
Function that creates a message locked animation
1496 1497 |
# File 'docs/01500_Yuki.rb', line 1496 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
1183 1184 |
# File 'docs/01500_Yuki.rb', line 1183 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
1195 1196 |
# File 'docs/01500_Yuki.rb', line 1195 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
1546 1547 |
# File 'docs/01500_Yuki.rb', line 1546 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
1113 1114 |
# File 'docs/01500_Yuki.rb', line 1113 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
1589 1590 |
# File 'docs/01500_Yuki.rb', line 1589 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
1103 1104 |
# File 'docs/01500_Yuki.rb', line 1103 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
1460 1461 |
# File 'docs/01500_Yuki.rb', line 1460 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
1124 1125 |
# File 'docs/01500_Yuki.rb', line 1124 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
1171 1172 |
# File 'docs/01500_Yuki.rb', line 1171 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
1384 1385 |
# File 'docs/01500_Yuki.rb', line 1384 def se_play(filename, volume = 100, pitch = 100) end |
.send_command_to(name, command, *args)
Send a command to an object in the resolver
1433 1434 |
# File 'docs/01500_Yuki.rb', line 1433 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
1207 1208 |
# File 'docs/01500_Yuki.rb', line 1207 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
1553 1554 |
# File 'docs/01500_Yuki.rb', line 1553 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
986 987 |
# File 'docs/01500_Yuki.rb', line 986 def wait(during, time_source: :GENERIC_TIME_SOURCE) end |
.wait_signal(name = nil, *args, &block) ⇒ SignalWaiter
Create a new SignalWaiter animation
1619 1620 |
# File 'docs/01500_Yuki.rb', line 1619 def wait_signal(name = nil, *args, &block) end |