class SK::AnimationSpriteRenderer

Attributes

images[RW]
origin[RW]

Public Class Methods

new(images) click to toggle source
# File lib/shirokuro/standard_components/rendering/animation_sprite_renderer.rb, line 6
def initialize images
        @images = images
        @origin = Vec2.new(0.5, 0.5)
end

Public Instance Methods

draw(context) click to toggle source
# File lib/shirokuro/standard_components/rendering/animation_sprite_renderer.rb, line 15
def draw context
        @images[@animations.frame].draw_rot(
                transform.position.x, transform.position.y, 0,
                transform.rotation.radians_to_degrees,
                @origin.x, @origin.y,
                transform.scale.x, transform.scale.y,
                Gosu::Color::WHITE
        )
end
start() click to toggle source
# File lib/shirokuro/standard_components/rendering/animation_sprite_renderer.rb, line 11
def start
        @animations = get_component(AnimationComponent)
end