Class: Yuki::Sprite

Inherits:
Sprite show all
Defined in:
scripts/01100 Yuki/00100 Yuki__Sprite.rb

Overview

Sprite with move_to command a self “animation”

Author:

  • Nuri Yuri

Instance Attribute Summary collapse

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Instance Attribute Details

#animatedBoolean

If the sprite has a self animation

Returns:

  • (Boolean)

#movingBoolean

If the sprite is moving

Returns:

  • (Boolean)

Instance Method Details

#anime(arr, delta = 1)

Start an animation

Parameters:

  • arr (Array<Array(Symbol, *args)>)

    Array of message

  • delta (Integer) (defaults to: 1)

    Number of frame to wait between each animation message

#anime_delta_set(v)

Change the time to wait between each animation message

Parameters:

#eval Also known as: class_eval, instance_eval, module_eval

Security patch

#execute_anime(n)

Note:

this method is used in animation message Array

Force the execution of the n next animation message

Parameters:

  • n (Integer)

    Number of animation message to execute

#move_to(x, y, nb_frame)

Move the sprite to a specific coordinate in a certain amount of frame

Parameters:

  • x (Integer)

    new x Coordinate

  • y (Integer)

    new y Coordinate

  • nb_frame (Integer)

    number of frame to go to the new coordinate

#stop_animation

Note:

this method is used in the animation message Array (because animation loops)

Stop the animation

#update

Update sprite (+move & animation)

#update_animation(no_delta)

Update the animation

Parameters:

  • no_delta (Boolean)

    if the number of frame to wait between each animation message is skiped

#update_position

Update the movement