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
24 25 26 27 28 29 30 |
# File 'lib/aniruby/frame.rb', line 24 def initialize(sprite, duration = 0.1) @sprite = sprite @duration = duration @width = @sprite.width @height = @sprite.height end |
Instance Attribute Details
#duration ⇒ Float
7 8 9 |
# File 'lib/aniruby/frame.rb', line 7 def duration @duration end |
#height ⇒ Integer (readonly) Also known as: h
13 14 15 |
# File 'lib/aniruby/frame.rb', line 13 def height @height end |
#sprite ⇒ Gosu::Image
10 11 12 |
# File 'lib/aniruby/frame.rb', line 10 def sprite @sprite end |
#width ⇒ Integer (readonly) Also known as: w
13 14 15 |
# File 'lib/aniruby/frame.rb', line 13 def width @width end |