Class: BattleUI::PlayerChoice::SpecialButton

Inherits:
UI::SpriteStack show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb

Overview

Element showing a special button

Constant Summary

Constants inherited from UI::SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes inherited from UI::SpriteStack

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

Instance Method Summary collapse

Methods inherited from UI::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, type) ⇒ SpecialButton

Create a new special button

Parameters:

  • viewport (Viewport)
  • type (Symbol)

    :last_item or :info



110
111
112
113
114
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 110

def initialize(viewport, type)
  super(viewport)
  @type = type
  create_sprites
end

Instance Method Details

#refresh

Update the special button content



117
118
119
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 117

def refresh
  @text.text = @type == :info ? 'Information' : $bag.last_battle_item.name
end