Class: UI::Quest::QuestButton

Inherits:
SpriteStack show all
Defined in:
scripts/01450 Systems/08000 Quest/00002 UI_Quest/00100 Quest_Button.rb

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

Constructor Details

#initialize(viewport, x, y, quest, status) ⇒ QuestButton

Initialize the QuestButton component

Parameters:



14
15
16
17
18
19
20
21
22
23
# File 'scripts/01450 Systems/08000 Quest/00002 UI_Quest/00100 Quest_Button.rb', line 14

def initialize(viewport, x, y, quest, status)
  super(viewport, x, y)
  @viewport = viewport
  @quest = quest
  @status = status
  @hidden = false
  create_frame
  create_title
  self.quest = quest
end

Instance Attribute Details

#hidden

Returns the value of attribute hidden.



4
5
6
# File 'scripts/01450 Systems/08000 Quest/00002 UI_Quest/00100 Quest_Button.rb', line 4

def hidden
  @hidden
end

#quest

Return the quest linked to this button

Returns:

  • PFM::Quests::Quest



7
8
9
# File 'scripts/01450 Systems/08000 Quest/00002 UI_Quest/00100 Quest_Button.rb', line 7

def quest
  @quest
end

Instance Method Details

#change_mode(mode) ⇒ Yuki::Animation::ScalarAnimation

Get the animation corresponding to the mode the button switches in

Parameters:

  • mode (Symbol)

Returns:

  • (Yuki::Animation::ScalarAnimation)


28
29
30
# File 'scripts/01450 Systems/08000 Quest/00002 UI_Quest/00100 Quest_Button.rb', line 28

def change_mode(mode)
  return (mode == :deployed ? opening_animation : compacting_animation)
end