Class: Yuki::Particle_Object

Inherits:
Object
  • Object
show all
Defined in:
docs/4_Systems_003_Map_Engine.rb

Overview

Class managing particle action handlers

Constant Summary collapse

ACTION_HANDLERS =

List of action handler to know how to compute the current frame of the particle

{}
ACTION_HANDLERS_ORDER =

Order of the particle handlers

[]
TILE_ZOOM =

Zoom of a tile to adjust coordinate

Configs.display.tilemap_settings.character_tile_zoom

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(character, data, on_tp = false, params = {}) ⇒ Particle_Object

Create a particle object

Parameters:

  • character (Game_Character) —

    the character on which the particle displays

  • data (Hash{Symbol => Hash}) —

    the data of the particle field of the data hash :

    enter: the particle animation when character enter on the tile
    stay: the particle animation when character stay on the tile
    leave: the particle animation when character leave the tile
    

    field of the particle animation max_counter: the number of frame on the animation loop: Boolean # if the animation loops or not data: an Array of animation instructions (Hash) field of an animation instruction state: Symbol # the new state of the particle zoom: Numeric # the zoom of the particle position: Symbol # the position type of the particle (:center_pos, :character_pos) file: String # the filename of the particle in Graphics/Particles/ angle: Numeric # the angle of the particle add_z: Integer # The z offset relatively to the character oy_offset: Integer # The offset in oy opacity: Integer # The opacity of the particle chara: Boolean # If the particle Texture is treaten like the Character bitmap rect: Array(Integer, Integer, Integer, Integer) # the parameter of the #set function of Rect (src_rect)

  • on_tp (Boolean) (defaults to: false) —

    tells the particle to skip the :enter animation or not

  • params (Hash) (defaults to: {}) —

    additional params for the animation

Options Hash (params):

  • :flow (Symbol) —

    define the kind of flow to use for the animation

  • :radius (Integer) —

    define the radius to use for the :update_radius_flow flow



1085
1086
# File 'docs/4_Systems_003_Map_Engine.rb', line 1085

def initialize(character, data, on_tp = false, params = {})
end

Instance Attribute Details

#disposed ⇒ Boolean (readonly) Also known as: disposed?

if the particle is disposed

Returns:

  • (Boolean)


1058
1059
1060
# File 'docs/4_Systems_003_Map_Engine.rb', line 1058

def disposed
  @disposed
end

Class Method Details

.add_handler(name, before = nil, &block)

Add a new action handler

Parameters:

  • name (Symbol) —

    name of the action

  • before (Symbol, nil) (defaults to: nil) —

    tell to put this handler before another handler



1020
1021
# File 'docs/4_Systems_003_Map_Engine.rb', line 1020

def self.add_handler(name, before = nil, &block)
end

Instance Method Details

#dispose

Dispose the particle



1124
1125
# File 'docs/4_Systems_003_Map_Engine.rb', line 1124

def dispose
end

#exectute_action(action)

Execute an animation instruction

Parameters:

  • action (Hash) —

    the animation instruction



1115
1116
# File 'docs/4_Systems_003_Map_Engine.rb', line 1115

def exectute_action(action)
end

#screen_z

Function that process screen z depending on original screen_y (without zoom)



1121
1122
# File 'docs/4_Systems_003_Map_Engine.rb', line 1121

def screen_z
end

#update

Update the particle animation



1088
1089
# File 'docs/4_Systems_003_Map_Engine.rb', line 1088

def update
end

#update_default_flow(data) ⇒ Boolean

Update the default particle state flow

Parameters:

  • data (Hash) —

    the data related to the current state

Returns:

  • (Boolean)


1106
1107
# File 'docs/4_Systems_003_Map_Engine.rb', line 1106

def update_default_flow(data)
end

#update_particle_info(data) ⇒ Boolean

Update the particle info

Parameters:

  • data (Hash) —

    the data related to the current state

Returns:

  • (Boolean) —

    if the update_sprite_position can be done



1101
1102
# File 'docs/4_Systems_003_Map_Engine.rb', line 1101

def update_particle_info(data)
end

#update_radius_flow(data) ⇒ Boolean

Update the radius particle kind flow

Parameters:

  • data (Hash) —

    the data related to the current state

Returns:

  • (Boolean)


1111
1112
# File 'docs/4_Systems_003_Map_Engine.rb', line 1111

def update_radius_flow(data)
end

#update_sprite_position

Update the position of the particle sprite



1118
1119
# File 'docs/4_Systems_003_Map_Engine.rb', line 1118

def update_sprite_position
end

#x ⇒ Integer

Get the real x of the particle on the map

Returns:

  • (Integer)


1092
1093
# File 'docs/4_Systems_003_Map_Engine.rb', line 1092

def x
end

#y ⇒ Integer

Get the real y of the particle on the map

Returns:

  • (Integer)


1096
1097
# File 'docs/4_Systems_003_Map_Engine.rb', line 1096

def y
end