Class: UI::InfoBox

Inherits:
SpriteStack show all
Includes:
BattleUI::GoingInOut, UI
Defined in:
docs/6_Contest_01_Scene.rb

Overview

Class that represents the Info Box of a creature during a contest

Defined Under Namespace

Classes: ScoreBar

Constant Summary collapse

BOX_X_COORDINATES =

X Coordinate of the info box depending on its index

Returns:

  • (Array<Integer>)
[3, 83, 163, 243]
SKIP_TURN_EFFECTS =

List of effects that prevent make the creature skip its turn

Returns:

  • (Array<Symbol>)
%i[skip_turn]
PREVENT_JAM_EFFECTS =

List of effects that prevent jam effects

Returns:

  • (Array<Symbol>)
%i[prevent_jam_one_turn prevent_jam_one_time]
NERVOUS_EFFECTS =

List of effects that make nervous

Returns:

  • (Array<Symbol>)
%i[nervous]

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #font_id, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods included from BattleUI::GoingInOut

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

Methods inherited from SpriteStack

#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, scene, index) ⇒ InfoBox

Create a new InfoBox

Parameters:



375
376
# File 'docs/6_Contest_01_Scene.rb', line 375

def initialize(viewport, scene, index)
end

Instance Attribute Details

#animation_handler ⇒ Yuki::Animation::Handler{ Symbol => Yuki::AnimationMixin} (readonly)

Get the animation handler



361
362
363
# File 'docs/6_Contest_01_Scene.rb', line 361

def animation_handler
  @animation_handler
end

#condition_star_sprites ⇒ Array<UI::Sprite> (readonly)

Confidence stars sprites

Returns:

  • (Array<UI::Sprite>)


367
368
369
# File 'docs/6_Contest_01_Scene.rb', line 367

def condition_star_sprites
  @condition_star_sprites
end

#index ⇒ Integer (readonly)

Index of the info box

Returns:

  • (Integer)


364
365
366
# File 'docs/6_Contest_01_Scene.rb', line 364

def index
  @index
end

#scene ⇒ Contest::Scene (readonly)

Get the scene linked to this object

Returns:



370
371
372
# File 'docs/6_Contest_01_Scene.rb', line 370

def scene
  @scene
end

Instance Method Details

#change_score(score) ⇒ Yuki::AnimationMixin

Change the score shown in the score bar

Parameters:

  • score (Integer) —

    Change to apply to the score

Returns:



405
406
# File 'docs/6_Contest_01_Scene.rb', line 405

def change_score(score)
end

#create_animation

Create the animation



378
379
# File 'docs/6_Contest_01_Scene.rb', line 378

def create_animation
end

#data=(creature)

Sets the creature shown by this box

Parameters:



389
390
# File 'docs/6_Contest_01_Scene.rb', line 389

def data=(creature)
end

#done? ⇒ Boolean

Tell if the InfoBox animations are done

Returns:

  • (Boolean)


385
386
# File 'docs/6_Contest_01_Scene.rb', line 385

def done?
end

#refresh

Refresh the box contents



396
397
# File 'docs/6_Contest_01_Scene.rb', line 396

def refresh
end

#refresh_icon

Note:

Used to refresh only the icon during mega-evolution

Refresh the creature icon



393
394
# File 'docs/6_Contest_01_Scene.rb', line 393

def refresh_icon
end

#selected=(selected)

Sets whether the info box is selected

Parameters:

  • selected (Boolean)


400
401
# File 'docs/6_Contest_01_Scene.rb', line 400

def selected=(selected)
end

#update

Update the InfoBox



381
382
# File 'docs/6_Contest_01_Scene.rb', line 381

def update
end