Class: BattleUI::AbilityBar
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- BattleUI::AbilityBar
- Includes:
- GoingInOut, MultiplePosition, UI
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb
Overview
Sprite of a Trainer in the battle
Direct Known Subclasses
Defined Under Namespace
Classes: Background
Constant Summary
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.
-
#no_go_out ⇒ Boolean
readonly
Get if the animation out should be not played automatically.
-
#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
-
#done? ⇒ Boolean
Tell if the animations are done.
-
#go_in_ability(no_go_out = false)
Tell the ability to go into the scene.
-
#initialize(viewport, scene, bank, position) ⇒ AbilityBar
constructor
Create a new Ability Bar.
-
#update
Update the animations.
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, position) ⇒ AbilityBar
Create a new Ability Bar
28 29 30 31 32 33 34 35 36 37 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 28 def initialize(, scene, bank, position) super() @scene = scene @bank = bank @position = position @animation_handler = Yuki::Animation::Handler.new @no_go_out = false create_sprites set_position(*sprite_position) end |
Instance Attribute Details
#animation_handler ⇒ Yuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation} (readonly)
Get the animation handler
9 10 11 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 9 def animation_handler @animation_handler end |
#bank ⇒ Integer (readonly)
Get the bank of the pokemon shown by the sprite
15 16 17 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 15 def bank @bank end |
#no_go_out ⇒ Boolean (readonly)
Get if the animation out should be not played automatically
21 22 23 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 21 def no_go_out @no_go_out end |
#position ⇒ Integer (readonly)
Get the position of the pokemon shown by the sprite
12 13 14 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 12 def position @position end |
#scene ⇒ Battle::Scene (readonly)
Get the scene linked to this object
18 19 20 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 18 def scene @scene end |
Instance Method Details
#done? ⇒ Boolean
Tell if the animations are done
46 47 48 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 46 def done? return @animation_handler.done? end |
#go_in_ability(no_go_out = false)
Tell the ability to go into the scene
55 56 57 58 59 60 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 55 def go_in_ability(no_go_out = false) delta = go_in_out_delta animation_handler[:in_out] ||= go_in_animation(no_go_out) animation_handler[:in_out].start(delta) @__in_out = :in end |
#update
Update the animations
40 41 42 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 40 def update @animation_handler.update end |