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 ⇒ Object
Returns the value of attribute duration.
-
#h ⇒ Object
readonly
Returns the value of attribute h.
-
#sprite ⇒ Object
Returns the value of attribute sprite.
-
#w ⇒ Object
readonly
Returns the value of attribute w.
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
15 16 17 18 19 20 21 |
# File 'lib/aniruby/frame.rb', line 15 def initialize(sprite, duration = 0.1) @sprite = sprite @duration = duration @w = @sprite.width @h = @sprite.height end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
6 7 8 |
# File 'lib/aniruby/frame.rb', line 6 def duration @duration end |
#h ⇒ Object (readonly)
Returns the value of attribute h.
7 8 9 |
# File 'lib/aniruby/frame.rb', line 7 def h @h end |
#sprite ⇒ Object
Returns the value of attribute sprite.
6 7 8 |
# File 'lib/aniruby/frame.rb', line 6 def sprite @sprite end |
#w ⇒ Object (readonly)
Returns the value of attribute w.
7 8 9 |
# File 'lib/aniruby/frame.rb', line 7 def w @w end |