Module: NuriYuri::DynamicLight

Defined in:
docs/4_Systems_951_DynamicLight.rb

Overview

Module managing the dynamic light system for PSDK

Defined Under Namespace

Classes: DynamicLightSprite, ScalableDLS

Constant Summary collapse

LIGHTS =

Returns List of light The first array component tell if it’s a normal light (:normal, centered on the character) or if it’s a directed light (:direction, in the direction of the character) The second component is the sprite shown under the map (light mask) The third component is the sprite shown in the map viewport for special effect mostly on top of the character.

Returns:

  • (Array<Array>)

    List of light The first array component tell if it’s a normal light (:normal, centered on the character) or if it’s a directed light (:direction, in the direction of the character) The second component is the sprite shown under the map (light mask) The third component is the sprite shown in the map viewport for special effect mostly on top of the character

[[:normal, 'dynamic_light/circle_320'], [:direction, 'dynamic_light/flash_light_mask', 'dynamic_light/flash_light_color'], [:normal, 'dynamic_light/circle_96']]
ANIMATIONS =

Returns List of light animation, Hash key are opacity: & zoom: (array of value).

Returns:

  • (Array<Hash>)

    List of light animation, Hash key are opacity: & zoom: (array of value)

[{zoom: [1], opacity: [255]}, {zoom: Array.new(120) { |i| 0.70 + 0.05 * Math.cos(6.28 * i / 120) }, opacity: Array.new(120) { |i| 240 + (15 * Math.cos(6.28 * i / 120)).to_i }}, {zoom: Array.new(120) { |i| 0.95 + 0.05 * Math.cos(6.28 * i / 120) }, opacity: [255]}]

Class Method Summary collapse

Class Method Details

.add(chara_id, light_type, animation_type = 0, zoom_count = 0, opacity_count = 0, *args, type: DynamicLightSprite) ⇒ Integer

Add a new light to the stack

Parameters:

  • chara_id (Integer)

    ID of the character (0 = player, -n = follower n, +n = event id)

  • light_type (Integer)

    Type of the light we’ll display on the character

  • animation_type (Integer) (defaults to: 0)

    Type of the animation performed on the light

  • zoom_count (Integer) (defaults to: 0)

    initial value of the zoom_count

  • opacity_count (Integer) (defaults to: 0)

    initial value of the opacity_count

  • args (Array)

    extra parameters

  • type (Class) (defaults to: DynamicLightSprite)

    Type of the sprite used to simulate the light

Returns:

  • (Integer)

    ID of the light in the light stack, if -1 => one of the parameter is invalid



46
47
# File 'docs/4_Systems_951_DynamicLight.rb', line 46

def add(chara_id, light_type, animation_type = 0, zoom_count = 0, opacity_count = 0, *args, type: DynamicLightSprite)
end

.clear_stack

Clear the light task



73
74
# File 'docs/4_Systems_951_DynamicLight.rb', line 73

def clear_stack
end

.create_viewport

Create the viewport



76
77
# File 'docs/4_Systems_951_DynamicLight.rb', line 76

def create_viewport
end

.determine_follower_character(chara_id) ⇒ Game_Character, ...

Recursively get to the asked follower and return the result

Parameters:

  • chara_id (Integer)

Returns:



51
52
# File 'docs/4_Systems_951_DynamicLight.rb', line 51

def determine_follower_character(chara_id)
end

.dispose_viewport

Dispose the light viewport



79
80
# File 'docs/4_Systems_951_DynamicLight.rb', line 79

def dispose_viewport
end

.light_sprite(light_id) ⇒ DynamicLightSprite?

Retrieve the light sprite

Parameters:

  • light_id

    ID of the light in the light stack

Returns:



64
65
# File 'docs/4_Systems_951_DynamicLight.rb', line 64

def light_sprite(light_id)
end

.load_blendmode

Load the light blend_mode



82
83
# File 'docs/4_Systems_951_DynamicLight.rb', line 82

def load_blendmode
end

.on_map_init

Part called when Scene_Map init itself (in order to reload all the lights)



85
86
# File 'docs/4_Systems_951_DynamicLight.rb', line 85

def on_map_init
end

.on_soft_reset

Clean everything on soft reset



92
93
# File 'docs/4_Systems_951_DynamicLight.rb', line 92

def on_soft_reset
end

.register

Register the update task



67
68
# File 'docs/4_Systems_951_DynamicLight.rb', line 67

def register
end

.start(&block)

Start the dynamic light processing

Parameters:

  • block (Proc)

    given_block that tells to start the DynamicLight process on the next update



16
17
# File 'docs/4_Systems_951_DynamicLight.rb', line 16

def start(&block)
end

.start_delay {|dl| ... }

Start delayed to the warp_end process

Yields:

  • (dl)

    given_block that tells to start the DynamicLight process on the next update

Yield Parameters:



25
26
# File 'docs/4_Systems_951_DynamicLight.rb', line 25

def start_delay
end

.started?Integer

Tells if the DynamicLight is started and running or not

Returns:

  • (Integer)


32
33
# File 'docs/4_Systems_951_DynamicLight.rb', line 32

def started?
end

.stop(from_start = false)

Stop the dynamic light processing

Parameters:

  • from_start (Boolean) (defaults to: false)

    tell if stop was called from start to prevent useless viewport dispose



20
21
# File 'docs/4_Systems_951_DynamicLight.rb', line 20

def stop(from_start = false)
end

.stop_delay

Stop delayed to the warp_end process



28
29
# File 'docs/4_Systems_951_DynamicLight.rb', line 28

def stop_delay
end

.switch_off(light_id)

Switch a light off

Parameters:

  • light_id (Integer)

    ID of the light in the light stack



59
60
# File 'docs/4_Systems_951_DynamicLight.rb', line 59

def switch_off(light_id)
end

.switch_on(light_id)

Switch a light on

Parameters:

  • light_id (Integer)

    ID of the light in the light stack



55
56
# File 'docs/4_Systems_951_DynamicLight.rb', line 55

def switch_on(light_id)
end

.unregister

Unregister the update task



70
71
# File 'docs/4_Systems_951_DynamicLight.rb', line 70

def unregister
end

.update

Update the lights



35
36
# File 'docs/4_Systems_951_DynamicLight.rb', line 35

def update
end

.viewportViewport

Return the viewport of the DynamicLight system

Returns:



89
90
# File 'docs/4_Systems_951_DynamicLight.rb', line 89

def viewport
end