Class: Yuki::Animation::SpriteCreationCommand

Inherits:
Command show all
Defined in:
docs/4_Systems_005_Animation.rb

Overview

Animation command responsive of creating sprites and storing them inside the resolver

Example :

SpriteCreationCommand.new(:main, :star1, SpriteSheet, [1, 3], [:select, 0, 1], [:set_position, 160, 120])
# This will create a spritesheet at the coordinate 160, 120 and display the cell 0,1

Instance Attribute Summary

Attributes inherited from TimedAnimation

#begin_time, #end_time, #parallel_animations, #root, #sub_animation, #time_source

Instance Method Summary collapse

Methods inherited from Command

#start, #update

Methods inherited from TimedAnimation

#done?, #in_parallel_of, #parallel_add, #play_before, #resolver=, #start, #update

Constructor Details

#initialize(viewport, name, type, args, *properties) ⇒ SpriteCreationCommand

Create a new SpriteCreationCommand

Parameters:

  • viewport (Symbol)

    viewport to use inside the resolver

  • name (Symbol)

    name of the sprite inside the resolver

  • type (Class)

    class to use in order to create the sprite

  • args (Array)

    argument to send to the sprite in order to create it (sent after viewport)

  • properties (Array<Array>)

    list of properties to call with their values



451
452
# File 'docs/4_Systems_005_Animation.rb', line 451

def initialize(viewport, name, type, args, *properties)
end