Class: Cute::Sprite
- Inherits:
-
Object
- Object
- Cute::Sprite
- Defined in:
- docstub/sprite.rb,
mrblib/sprite.rb
Instance Attribute Summary collapse
-
#h ⇒ Float
The height of the sprite.
-
#w ⇒ Float
The width of the sprite.
Instance Method Summary collapse
-
#draw ⇒ Object
Draws the sprite on the screen.
- #inspect ⇒ Object
-
#loop ⇒ Boolean
Returns whether animations will loop.
-
#loop=(value) ⇒ Boolean
Sets whether animations will loop.
-
#play(name) ⇒ Object
Switches to a new animation and starts playing it from the beginning.
-
#playing?(name) ⇒ Boolean
Returns true if the sprite is currently playing the animation.
-
#update ⇒ Object
Updates the sprite’s animation.
Instance Attribute Details
#h ⇒ Float
Returns the height of the sprite.
7 8 9 |
# File 'docstub/sprite.rb', line 7 def h @h end |
#w ⇒ Float
Returns the width of the sprite.
4 5 6 |
# File 'docstub/sprite.rb', line 4 def w @w end |
Instance Method Details
#draw ⇒ Object
Draws the sprite on the screen
11 12 |
# File 'docstub/sprite.rb', line 11 def draw end |
#inspect ⇒ Object
3 4 5 |
# File 'mrblib/sprite.rb', line 3 def inspect "#<Cute::Sprite:#{sprintf("0x%x", (object_id << 1))} name:#{name.inspect} w:#{w} h:#{h} opacity:#{opacity}>" end |
#loop ⇒ Boolean
Returns whether animations will loop
33 34 |
# File 'docstub/sprite.rb', line 33 def loop end |
#loop=(value) ⇒ Boolean
Sets whether animations will loop
39 40 |
# File 'docstub/sprite.rb', line 39 def loop=(value) end |
#play(name) ⇒ Object
Switches to a new animation and starts playing it from the beginning
22 23 |
# File 'docstub/sprite.rb', line 22 def play(name) end |
#playing?(name) ⇒ Boolean
Returns true if the sprite is currently playing the animation
28 29 |
# File 'docstub/sprite.rb', line 28 def (name) end |
#update ⇒ Object
Updates the sprite’s animation
16 17 |
# File 'docstub/sprite.rb', line 16 def update end |