Class: BattleUI::TrainerPartyBalls
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- BattleUI::TrainerPartyBalls
- Includes:
- GoingInOut, MultiplePosition, UI
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.rb
Overview
Object that display the Battle Party Balls of a trainer in Battle
Remaining Pokemon, Pokemon with status
Defined Under Namespace
Classes: BallSprite
Constant Summary collapse
- BALL_X =
X coordinate of the first ball in the stack depending on the bank
[3, 7]
- BALL_Y =
Y coordinate of the first ball in the stack depending on the bank
[-3, -3]
- BALL_DELTA =
Delta X between each balls
14
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 party shown.
-
#position ⇒ Integer
readonly
Get the position.
-
#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
-
#done? ⇒ Boolean
Tell if the UI has done displaying its animation.
-
#initialize(viewport, scene, bank) ⇒ TrainerPartyBalls
constructor
Create a new Trainer Party Balls.
-
#refresh
Refresh the content of the bar.
-
#update
Update all the animation of this UI element.
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, bank) ⇒ TrainerPartyBalls
Create a new Trainer Party Balls
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.rb', line 32 def initialize(, scene, bank) super() @animation_handler = Yuki::Animation::Handler.new @bank = bank @position = 0 @scene = scene create_graphics set_position(*sprite_position) refresh go_out(-999) update 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/00102 TrainerPartyBalls.rb', line 17 def animation_handler @animation_handler end |
#bank ⇒ Integer (readonly)
Get the bank of the party shown
23 24 25 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.rb', line 23 def bank @bank end |
#position ⇒ Integer (readonly)
Get the position
20 21 22 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.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/00102 TrainerPartyBalls.rb', line 26 def scene @scene end |
Instance Method Details
#done? ⇒ Boolean
Tell if the UI has done displaying its animation
57 58 59 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.rb', line 57 def done? return @animation_handler.done? end |
#refresh
Refresh the content of the bar
51 52 53 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.rb', line 51 def refresh self.data = 6.times.map { |i| @scene.logic.battler(@bank, i) } end |
#update
Update all the animation of this UI element
46 47 48 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00102 TrainerPartyBalls.rb', line 46 def update @animation_handler.update end |