Module: Util::Warp

Defined in:
docs/01450_Systems_00003_Map_Engine.rb

Overview

Module that hold a warping function

Author:

  • Nuri Yuri

Class Method Summary collapse

Class Method Details

.find_event_from(map_id, name_or_id) ⇒ Array<Integer>

Find the event coordinate in another map

Parameters:

  • map_id (Integer)

    ID of the map where to warp

  • name_or_id (Integer, String)

    name or ID of the event that will be found

Returns:

  • (Array<Integer>)

    x & y coordinate of the event in the other map



30
31
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 30

def find_event_from(map_id, name_or_id)
end

.setup_transition(type)

Define the transition for the warping process

Parameters:

  • type (Integer)

    type of transition



17
18
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 17

def setup_transition(type)
end

.to(map_id, name_or_id, transition_type = 0, offset_x: 0, offset_y: 1, direction: 0)

Warp to an event of another map (below by default)

Parameters:

  • map_id (Integer)

    ID of the map where to warp

  • name_or_id (Integer, String)

    name or ID of the event that will be found

  • transition_type (Integer) (defaults to: 0)

    0 = no transition, 1 = circular transition, 2 = directed transition, -1 = bw transition

  • offset_x (Integer) (defaults to: 0)

    offset x to add to the warp x coordinate

  • offset_y (Integer) (defaults to: 1)

    offset y to add to the warp y coordinate

  • direction (Integer) (defaults to: 0)

    new direction of the player



13
14
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 13

def to(map_id, name_or_id, transition_type = 0, offset_x: 0, offset_y: 1, direction: 0)
end

.warp(map_id, x_pos, y_pos, direction)

Warp to the specified coordinate

Parameters:

  • map_id (Integer)

    ID of the map where to warp

  • x_pos (Integer)

    x coordinate where to warp

  • y_pos (Integer)

    y coordinate where to warp

  • direction (Integer)

    new direction of the player



24
25
# File 'docs/01450_Systems_00003_Map_Engine.rb', line 24

def warp(map_id, x_pos, y_pos, direction)
end