Class: BattleUI::TrainerSprite

Inherits:
ShaderedSprite show all
Includes:
GoingInOut, MultiplePosition
Defined in:
docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb

Overview

Sprite of a Trainer in the battle

Constant Summary collapse

FADE_AWAY_PIXEL_COUNT =

Number of pixels the sprite has to move in other to fade away from the scene

160
BACK_FRAME_COUNT =

Define the number of frames inside a back trainer

2

Instance Attribute Summary collapse

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 included from MultiplePosition

#enemy?

Methods included from GoingInOut

#go_in, #go_out, #in?, #out?

Methods inherited from Sprite

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

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, scene, battler, bank, position, battle_info) ⇒ TrainerSprite

Create a new TrainerSprite

Parameters:



942
943
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 942

def initialize(viewport, scene, battler, bank, position, battle_info)
end

Instance Attribute Details

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

Get the animation handler



923
924
925
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 923

def animation_handler
  @animation_handler
end

#bankInteger (readonly)

Get the bank of the pokemon shown by the sprite

Returns:

  • (Integer)


929
930
931
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 929

def bank
  @bank
end

#positionInteger (readonly)

Get the position of the pokemon shown by the sprite

Returns:

  • (Integer)


926
927
928
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 926

def position
  @position
end

#sceneBattle::Scene (readonly)

Get the scene linked to this object

Returns:



932
933
934
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 932

def scene
  @scene
end

Instance Method Details

#done?Boolean

Tell if the sprite animations are done

Returns:

  • (Boolean)


949
950
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 949

def done?
end

#show_next_frame

Note:

Frames are ordered on the vertical axis

Set the battler on its next frame



953
954
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 953

def show_next_frame
end

#show_previous_frame

Note:

Frames are ordered on the vertical axis

Set the battler on its previous frame



957
958
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 957

def show_previous_frame
end

#update

Update the sprite



945
946
# File 'docs/01600_Alpha_25_Battle_Engine_00001_Battle_Scene.rb', line 945

def update
end