Class: UI::MapPanel

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00003 Map Engine/00001 Graphics/00600 MapPanel.rb

Overview

Show a panel about the currently visited zone on the map

Constant Summary collapse

DELTA_Y =

Animation delta y

32

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes inherited from SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods inherited from SpriteStack

#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, zone) ⇒ MapPanel

Create a new MapPanel

Parameters:



9
10
11
12
13
14
15
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/00600 MapPanel.rb', line 9

def initialize(viewport, zone)
  super(viewport, *initial_coordinates, default_cache: :windowskin)
  @zone = zone
  create_sprites
  self.z = 5000
  viewport.sort_z
end

Instance Method Details

#done?Boolean

Tell if the animation is done and the pannel should be disposed

Returns:

  • (Boolean)


26
27
28
29
30
31
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/00600 MapPanel.rb', line 26

def done?
  return false if Graphics.frozen?
  return true unless @animation

  return @animation.done?
end

#update

Update the panel animation



18
19
20
21
22
23
# File 'scripts/01450 Systems/00003 Map Engine/00001 Graphics/00600 MapPanel.rb', line 18

def update
  return if Graphics.frozen?

  create_animation unless @animation
  @animation.update
end