Module: BattleUI::GoingInOut

Included in:
AbilityBar, ExpDistribution::Statistics, GenericChoice, InfoBar, PokemonSprite, TrainerPartyBalls, TrainerSprite
Defined in:
scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00001 GoingInOut.rb

Overview

Module that implements the Going In & Out animation for each sprites/stacks of the UI

To work this module requires `animation_handler` to return a `Yuki::Animation::Handler` !

Instance Method Summary collapse

Instance Method Details

#animation_handlerYuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation}

Get the animation handler

Returns:

  • (Yuki::Animation::Handler{ Symbol => Yuki::Animation::TimedAnimation})


11
12
13
14
15
16
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00001 GoingInOut.rb', line 11

def go_in
  delta = go_in_out_delta
  animation_handler[:in_out] ||= go_in_animation
  animation_handler[:in_out].start(delta)
  @__in_out = :in
end

#go_in

Tell the element to go into the scene



11
12
13
14
15
16
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00001 GoingInOut.rb', line 11

def go_in
  delta = go_in_out_delta
  animation_handler[:in_out] ||= go_in_animation
  animation_handler[:in_out].start(delta)
  @__in_out = :in
end

#go_out(forced_delta = nil)

Tell the element to go out of the scene

Parameters:

  • forced_delta (Float) (defaults to: nil)

    set the forced delta to force the animation to be performed with a specific delta



20
21
22
23
24
25
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00001 GoingInOut.rb', line 20

def go_out(forced_delta = nil)
  delta = forced_delta || go_in_out_delta
  animation_handler[:in_out] ||= go_out_animation
  animation_handler[:in_out].start(delta)
  @__in_out = :out
end

#in?Boolean

Note:

By default a UI element is considered as in because it's initialized in its in position

Tell if the UI element is in

Returns:

  • (Boolean)


30
31
32
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00001 GoingInOut.rb', line 30

def in?
  return !out?
end

#out?Boolean

Tell if the UI element is out

Returns:

  • (Boolean)


36
37
38
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00001 GoingInOut.rb', line 36

def out?
  return @__in_out == :out
end