Class: UI::MoveTeaching::NewSkill

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/00301 MoveTeaching/00002 UI/00040 NewSkill.rb

Overview

UI part displaying the new skill informations in the Skill Learn scene

Constant Summary

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

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, #update_animation, #update_position, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, index) ⇒ NewSkill

Create informations of the new skill to learn

Parameters:



10
11
12
13
14
15
16
17
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00040 NewSkill.rb', line 10

def initialize(viewport, index)
  super(viewport, 35, 133, default_cache: :interface)
  create_texts
  create_graphics
  @new_skill_index = index
  self.selected = false
  self.visible = false
end

Instance Attribute Details

#selectedBoolean

Returns if the move is currently selected.

Returns:

  • (Boolean)

    if the move is currently selected



6
7
8
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00040 NewSkill.rb', line 6

def selected
  @selected
end

Instance Method Details

#data=(skill)

Set the skill data

Parameters:



21
22
23
24
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00040 NewSkill.rb', line 21

def data=(skill)
  super
  @selector.visible = @selected
end

#visibleBoolean

Get the visibility of the sprite

Returns:

  • (Boolean)


35
36
37
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00040 NewSkill.rb', line 35

def visible
  return @stack[1].visible
end

#visible=(value)

Set the visibility of the sprite

Parameters:

  • value (Boolean)

    new visibility



28
29
30
31
# File 'scripts/01450 Systems/00301 MoveTeaching/00002 UI/00040 NewSkill.rb', line 28

def visible=(value)
  super(value && @data)
  @selector.visible = @selected
end