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

Instance Method Details

#bankInteger

Get the object bank

Returns:



# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14

#base_position_v1Array(Integer, Integer)

Get the position of the object (depeding on enemy?) in 1v1 battle

Returns:



# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14

#base_position_v2Array(Integer, Integer)

Get the position of the object (depending on enemy?) in 2v2+ battle

Returns:



# 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

Returns:

  • (Boolean)


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

#positionInteger

Get the object position in the bank

Returns:



# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14

#sceneBattle::Scene

Get the battle scene to access all information

Returns:



# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00003 MultiplePosition.rb', line 14