Module: BattleUI::MultiplePosition
- Included in:
- AbilityBar, InfoBar, PokemonSprite, TrainerPartyBalls, TrainerSprite
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb
Overview
Module helping to position any sprite that can get several positions depending on the battle mode
All class including this module should define the following methods
- `scene` that returns the current Battle Scene
- `position` that returns the position of the current object in its bank (0, 1, 2, ...)
- `bank` that returns the bank of the current object (0 = ally, 1 = enemies)
- `base_position_v1` that returns the base position of the object in 1v1 battles
- `base_position_v2` that returns the base position of the object in 2v2+ battles
- `offset_position_v2` that returns the offset of the object depending on its bank (this offset is multiplied to position)
This module will define a `sprite_position` function that will compute the x & y position this element should get
Instance Method Summary collapse
-
#bank ⇒ Integer
Get the object bank.
-
#base_position_v1 ⇒ Array(Integer, Integer)
Get the position of the object (depeding on enemy?) in 1v1 battle.
-
#base_position_v2 ⇒ Array(Integer, Integer)
Get the position of the object (depending on enemy?) in 2v2+ battle.
-
#enemy? ⇒ Boolean
Tell if the sprite is from the enemy side.
-
#offset_position_v2
Get the offset factor of the object (depending on enemy?) this will be multiplied to position.
-
#position ⇒ Integer
Get the object position in the bank.
-
#scene ⇒ Battle::Scene
Get the battle scene to access all information.
Instance Method Details
#bank ⇒ Integer
Get the object bank
|
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14
|
#base_position_v1 ⇒ Array(Integer, Integer)
Get the position of the object (depeding on enemy?) in 1v1 battle
|
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14
|
#base_position_v2 ⇒ Array(Integer, Integer)
Get the position of the object (depending on enemy?) in 2v2+ battle
|
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14
|
#enemy? ⇒ Boolean
Tell if the sprite is from the enemy side
34 35 36 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 34 def enemy? return bank == 1 end |
#offset_position_v2
Get the offset factor of the object (depending on enemy?) this will be multiplied to position
|
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14
|
#position ⇒ Integer
Get the object position in the bank
|
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14
|
#scene ⇒ Battle::Scene
Get the battle scene to access all information
|
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14
|