Class: BattleUI::InfoBar
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- BattleUI::InfoBar
- Includes:
- GoingInOut, MultiplePosition, UI
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb
Overview
Since .25 InfoBar completely ignore bank & position info about Pokemon to make thing easier regarding positionning
Object that show the Battle Bar of a Pokemon in Battle
Defined Under Namespace
Classes: Background, PokemonCaughtSprite
Constant Summary collapse
- HP_BAR_INFO =
The information of the HP Bar
[92, 4, 0, 0, 6]
- EXP_BAR_INFO =
The information of the Exp Bar
[88, 2, 0, 0, 1]
Constants inherited from UI::SpriteStack
UI::SpriteStack::NO_INITIAL_IMAGE
Instance Attribute Summary collapse
-
#animation_handler ⇒ Yuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation}
readonly
Get the animation handler.
-
#bank ⇒ Integer
readonly
Get the bank of the pokemon shown by the sprite.
-
#pokemon ⇒ PFM::PokemonBattler
Get the Pokemon shown by the InfoBar.
-
#position ⇒ Integer
readonly
Get the position of the pokemon shown by the sprite.
-
#scene ⇒ Battle::Scene
readonly
Get the scene linked to this object.
Attributes inherited from UI::SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
- #data=(pokemon)
-
#done? ⇒ Boolean
Tell if the InfoBar animations are done.
-
#initialize(viewport, scene, pokemon, bank, position) ⇒ InfoBar
constructor
Create a new InfoBar.
-
#refresh
Refresh the bar contents.
-
#update
Update the InfoBar.
Methods included from MultiplePosition
Methods included from GoingInOut
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, scene, pokemon, bank, position) ⇒ InfoBar
Create a new InfoBar
33 34 35 36 37 38 39 40 41 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 33 def initialize(, scene, pokemon, bank, position) super() @animation_handler = Yuki::Animation::Handler.new @bank = bank @position = position @scene = scene create_sprites self.pokemon = pokemon end |
Instance Attribute Details
#animation_handler ⇒ Yuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation} (readonly)
Get the animation handler
17 18 19 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 17 def animation_handler @animation_handler end |
#bank ⇒ Integer (readonly)
Get the bank of the pokemon shown by the sprite
23 24 25 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 23 def bank @bank end |
#pokemon ⇒ PFM::PokemonBattler
Get the Pokemon shown by the InfoBar
14 15 16 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 14 def pokemon @pokemon end |
#position ⇒ Integer (readonly)
Get the position of the pokemon shown by the sprite
20 21 22 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 20 def position @position end |
#scene ⇒ Battle::Scene (readonly)
Get the scene linked to this object
26 27 28 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 26 def scene @scene end |
Instance Method Details
#data=(pokemon)
72 73 74 75 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 72 def data=(pokemon) super @star.visible = pokemon.shiny && !pokemon.egg? end |
#done? ⇒ Boolean
Tell if the InfoBar animations are done
50 51 52 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 50 def done? return @animation_handler.done? end |
#refresh
Refresh the bar contents
62 63 64 65 66 67 68 69 70 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 62 def refresh if @pokemon self.visible = true self.data = @pokemon set_position(*sprite_position) if in? else self.visible = false end end |
#update
Update the InfoBar
44 45 46 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00101 InfoBar.rb', line 44 def update @animation_handler.update end |