class RubyMan::Sprite
drawable animated image
Attributes
frames[RW]
height[RW]
width[RW]
Public Class Methods
[](resource_name)
click to toggle source
# File lib/ruby_man/sprite.rb, line 13 def self.[](resource_name) ResourceManager[resource_name] end
new()
click to toggle source
# File lib/ruby_man/sprite.rb, line 9 def initialize @frames = [] end
Public Instance Methods
draw(x, y, depth = 0, rotation = 0, frame = 0, scale = 1.0)
click to toggle source
# File lib/ruby_man/sprite.rb, line 17 def draw(x, y, depth = 0, rotation = 0, frame = 0, scale = 1.0) frames[frame].draw_rot(x + @width / 2, y + @height / 2, -depth, rotation, 0.5, 0.5, scale, scale) end
draw_centered(x, y, depth = 0, rotation = 0, frame = 0, scale = 1.0)
click to toggle source
# File lib/ruby_man/sprite.rb, line 22 def draw_centered(x, y, depth = 0, rotation = 0, frame = 0, scale = 1.0) frames[frame].draw_rot(x, y, -depth, rotation, 0.5, 0.5, scale, scale) end