Class: BattleUI::PlayerChoice::ItemInfo

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

Overview

UI showing the info about the last used item

Constant Summary

Constants inherited from UI::SpriteStack

UI::SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from UI::SpriteStack

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

Instance Method Summary collapse

Methods included from HideShow

#hide, #show

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

Constructor Details

#initialize(viewport) ⇒ ItemInfo

Create a new Item Info box

Parameters:



139
140
141
142
143
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 139

def initialize(viewport)
  super(viewport)
  @animation_handler = Yuki::Animation::Handler.new
  create_sprites
end

Instance Attribute Details

#animation_handlerYuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation} (readonly)

Get the animation handler

Returns:

  • (Yuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation})


136
137
138
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 136

def animation_handler
  @animation_handler
end

Instance Method Details

#data=(item)

Set the data shown by the UI

Parameters:



147
148
149
150
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 147

def data=(item)
  super
  @remaining.text = $bag.item_quantity(item.db_symbol).to_s
end

#done?Boolean

Tell if the animation is done

Returns:

  • (Boolean)


159
160
161
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 159

def done?
  return @animation_handler.done?
end

#update

Update the sprite



153
154
155
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00200 PlayerChoice.rb', line 153

def update
  @animation_handler.update
end