Class: BattleUI::AbilityBar::Background

Inherits:
ShaderedSprite show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb

Overview

Class showing the right background depending on the pokemon

Instance Attribute Summary

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords, #update

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Instance Method Details

#background_filename(pokemon)



140
141
142
143
144
145
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 140

def background_filename(pokemon)
  return 'battle/ability_bar_enemy' if pokemon.bank != 0
  return 'battle/ability_bar_actor' if pokemon.from_party?

  return 'battle/ability_bar_ally'
end

#data=(pokemon)

Set the Pokemon Data

Parameters:



134
135
136
137
138
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00104 AbilityBar.rb', line 134

def data=(pokemon)
  return unless (self.visible = pokemon)

  set_bitmap(background_filename(pokemon), :interface)
end