Class: Yuki::Sprite

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)


7
8
9
# File 'docs/01500_Yuki.rb', line 7

def animated
  @animated
end

#movingBoolean

If the sprite is moving

Returns:

  • (Boolean)


10
11
12
# File 'docs/01500_Yuki.rb', line 10

def moving
  @moving
end

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



26
27
# File 'docs/01500_Yuki.rb', line 26

def anime(arr, delta = 1)
end

#anime_delta_set(v)

Change the time to wait between each animation message

Parameters:

  • v (Integer)


43
44
# File 'docs/01500_Yuki.rb', line 43

def anime_delta_set(v)
end

#eval Also known as: class_eval, instance_eval, module_eval

Security patch



46
47
# File 'docs/01500_Yuki.rb', line 46

def eval
end

#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



35
36
# File 'docs/01500_Yuki.rb', line 35

def execute_anime(n)
end

#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



18
19
# File 'docs/01500_Yuki.rb', line 18

def move_to(x, y, nb_frame)
end

#stop_animation

Note:

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

Stop the animation



39
40
# File 'docs/01500_Yuki.rb', line 39

def stop_animation
end

#update

Update sprite (+move & animation)



12
13
# File 'docs/01500_Yuki.rb', line 12

def update
end

#update_animation(no_delta)

Update the animation

Parameters:

  • no_delta (Boolean)

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



30
31
# File 'docs/01500_Yuki.rb', line 30

def update_animation(no_delta)
end

#update_position

Update the movement



21
22
# File 'docs/01500_Yuki.rb', line 21

def update_position
end