Class: AniRuby::Frame
- Inherits:
-
Object
- Object
- AniRuby::Frame
- Defined in:
- lib/aniruby/frame.rb
Overview
A frame has a sprite that’s Gosu::Image and a duration specified in milliseconds
Instance Attribute Summary collapse
- #duration ⇒ Float
- #height ⇒ Integer (also: #h) readonly
- #sprite ⇒ Gosu::Image
- #width ⇒ Integer (also: #w) readonly
Instance Method Summary collapse
-
#initialize(sprite, duration = 0.1) ⇒ Frame
constructor
Create a new frame.
Constructor Details
#initialize(sprite, duration = 0.1) ⇒ Frame
Create a new frame
23 24 25 26 27 28 29 |
# File 'lib/aniruby/frame.rb', line 23 def initialize(sprite, duration = 0.1) @sprite = sprite @duration = duration @width = @sprite.width @height = @sprite.height end |
Instance Attribute Details
#duration ⇒ Float
6 7 8 |
# File 'lib/aniruby/frame.rb', line 6 def duration @duration end |
#height ⇒ Integer (readonly) Also known as: h
12 13 14 |
# File 'lib/aniruby/frame.rb', line 12 def height @height end |
#sprite ⇒ Gosu::Image
9 10 11 |
# File 'lib/aniruby/frame.rb', line 9 def sprite @sprite end |
#width ⇒ Integer (readonly) Also known as: w
12 13 14 |
# File 'lib/aniruby/frame.rb', line 12 def width @width end |