Class: Cute::Sprite

Inherits:
Object
  • Object
show all
Defined in:
docstub/sprite.rb,
mrblib/sprite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hFloat

Returns the height of the sprite.

Returns:

  • (Float)

    the height of the sprite



7
8
9
# File 'docstub/sprite.rb', line 7

def h
  @h
end

#wFloat

Returns the width of the sprite.

Returns:

  • (Float)

    the width of the sprite



4
5
6
# File 'docstub/sprite.rb', line 4

def w
  @w
end

Instance Method Details

#drawObject

Draws the sprite on the screen

Returns:

  • nil



11
12
# File 'docstub/sprite.rb', line 11

def draw
end

#inspectObject



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

#loopBoolean

Returns whether animations will loop

Returns:

  • (Boolean)

    true if animations loop, false if they stop at the last frame



33
34
# File 'docstub/sprite.rb', line 33

def loop
end

#loop=(value) ⇒ Boolean

Sets whether animations will loop

Parameters:

  • value (Boolean)

    true to make animations loop, false to make them stop at the last frame

Returns:

  • (Boolean)

    the new loop value



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

Parameters:

  • name (String)

    the name of the animation to play

Returns:

  • nil



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

Parameters:

  • name (String)

    the name of the animation

Returns:

  • (Boolean)


28
29
# File 'docstub/sprite.rb', line 28

def playing?(name)
end

#updateObject

Updates the sprite’s animation

Returns:

  • nil



16
17
# File 'docstub/sprite.rb', line 16

def update
end