Class: Contest::Visual

Inherits:
Object show all
Defined in:
docs/6_Contest_02_Visual.rb

Overview

Class that manages all the things that are visually seen on the screen

Constant Summary collapse

CONTEST_DEFAULT_BACKGROUND =

Default background for contests

Returns:

'contestbacks/base'
AUDIENCE_REACTION_SE =

Default audience reaction Sound Effect

Returns:

  • (Array<String, Integer, Integer>)
['audience_cheer', 75, 100]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scene) ⇒ Visual

Create a new visual instance

Parameters:

  • scene (Scene) —

    scene that hold the logic object



56
57
# File 'docs/6_Contest_02_Visual.rb', line 56

def initialize(scene)
end

Instance Attribute Details

#animations ⇒ Array (readonly)

List of the animations

Returns:

  • (Array)


12
13
14
# File 'docs/6_Contest_02_Visual.rb', line 12

def animations
  @animations
end

#background ⇒ Sprite (readonly)

The background sprite

Returns:



24
25
26
# File 'docs/6_Contest_02_Visual.rb', line 24

def background
  @background
end

#camera_positionner

Not used (avoid crash when using MoveAnimation)



53
54
55
# File 'docs/6_Contest_02_Visual.rb', line 53

def camera_positionner
  @camera_positionner
end

#contestants ⇒ Array<UI::ContestCreatureSprite> (readonly)

List of contestants sprites

Returns:



36
37
38
# File 'docs/6_Contest_02_Visual.rb', line 36

def contestants
  @contestants
end

#coordinators_with_contestants ⇒ Array<UI::CoordinatorWithContestant> (readonly)

List of coordinator with contestants sprites

Returns:

  • (Array<UI::CoordinatorWithContestant>)


39
40
41
# File 'docs/6_Contest_02_Visual.rb', line 39

def coordinators_with_contestants
  @coordinators_with_contestants
end

#curtains ⇒ Array<UI::CurtainSprite> (readonly)

The curtains sprites

Returns:



33
34
35
# File 'docs/6_Contest_02_Visual.rb', line 33

def curtains
  @curtains
end

#info_boxes ⇒ Array<UI::InfoBox> (readonly)

The Info boxes UIs

Returns:



45
46
47
# File 'docs/6_Contest_02_Visual.rb', line 45

def info_boxes
  @info_boxes
end

#judge_sprite ⇒ Sprite (readonly)

The judge sprite

Returns:



30
31
32
# File 'docs/6_Contest_02_Visual.rb', line 30

def judge_sprite
  @judge_sprite
end

#lock_info_boxes ⇒ Boolean

Whether to lock the info boxes

Returns:

  • (Boolean)


48
49
50
# File 'docs/6_Contest_02_Visual.rb', line 48

def lock_info_boxes
  @lock_info_boxes
end

#result_banners ⇒ Array<UI::ResultBanner> (readonly)

Result banners UIs

Returns:



51
52
53
# File 'docs/6_Contest_02_Visual.rb', line 51

def result_banners
  @result_banners
end

#scene ⇒ Contest::Scene (readonly)

Get the scene used to instanciate this Visual instance

Returns:



9
10
11
# File 'docs/6_Contest_02_Visual.rb', line 9

def scene
  @scene
end

#skill_choice_ui ⇒ UI::ContestSkillChoice (readonly)

The skill choice UI



42
43
44
# File 'docs/6_Contest_02_Visual.rb', line 42

def skill_choice_ui
  @skill_choice_ui
end

#target_sprite ⇒ Sprite (readonly)

The target sprite

Returns:



27
28
29
# File 'docs/6_Contest_02_Visual.rb', line 27

def target_sprite
  @target_sprite
end

#to_dispose ⇒ Array (readonly)

The elements to dispose on #dispose

Returns:

  • (Array)


21
22
23
# File 'docs/6_Contest_02_Visual.rb', line 21

def to_dispose
  @to_dispose
end

#viewport ⇒ Viewport (readonly)

The viewport used to show the sprites

Returns:



15
16
17
# File 'docs/6_Contest_02_Visual.rb', line 15

def viewport
  @viewport
end

#viewport_sub ⇒ Viewport (readonly)

The viewport used to show some UI part

Returns:



18
19
20
# File 'docs/6_Contest_02_Visual.rb', line 18

def viewport_sub
  @viewport_sub
end

Instance Method Details

#add_score_to_box(contestant, score)

Add score to the info box of the given contestant

Parameters:

  • contestant (Contest::ContestCreature)
  • score (Integer)


192
193
# File 'docs/6_Contest_02_Visual.rb', line 192

def add_score_to_box(contestant, score)
end

#announce_results_message

Show the contest results message



242
243
# File 'docs/6_Contest_02_Visual.rb', line 242

def announce_results_message
end

#audience_reaction_animation(score, difficulty)

Create the audience reaction animation based on the score and difficulty

Parameters:

  • score (Integer) —

    Score obtained by the current contestant

  • difficulty (Symbol) —

    Difficulty of the contest



225
226
# File 'docs/6_Contest_02_Visual.rb', line 225

def audience_reaction_animation(score, difficulty)
end

#change_enthousiasm(amount)

Change the enthousiasm shown by the judge

Parameters:

  • amount (Integer)


205
206
# File 'docs/6_Contest_02_Visual.rb', line 205

def change_enthousiasm(amount)
end

#close_curtains

Show the curtains closing animation



163
164
# File 'docs/6_Contest_02_Visual.rb', line 163

def close_curtains
end

#congratulations_message

Show the congratulations message



257
258
# File 'docs/6_Contest_02_Visual.rb', line 257

def congratulations_message
end

#contestant_go_in(contestant)

Make a contestant go in

Parameters:

  • contestant (Contest::ContestCreature)


140
141
# File 'docs/6_Contest_02_Visual.rb', line 140

def contestant_go_in(contestant)
end

#contestant_go_out(contestant)

Make a contestant go out

Parameters:

  • contestant (Contest::ContestCreature)


144
145
# File 'docs/6_Contest_02_Visual.rb', line 144

def contestant_go_out(contestant)
end

#contestant_sprite(creature) ⇒ UI::ContestCreatureSprite

Get the sprite of a creature

Parameters:

Returns:



176
177
# File 'docs/6_Contest_02_Visual.rb', line 176

def contestant_sprite(creature)
end

#coordinator_in_animation(contestant)

Play the primary judging in animation of a Coordinator with its Contestant sprite

Parameters:



216
217
# File 'docs/6_Contest_02_Visual.rb', line 216

def coordinator_in_animation(contestant)
end

#coordinator_out_animation(contestant)

Play the primary judging out animation of a Coordinator with its Contestant sprite

Parameters:



220
221
# File 'docs/6_Contest_02_Visual.rb', line 220

def coordinator_out_animation(contestant)
end

#dispose

Dispose the visuals



66
67
# File 'docs/6_Contest_02_Visual.rb', line 66

def dispose
end

#hide_info_boxes

Hide all the info boxes



180
181
# File 'docs/6_Contest_02_Visual.rb', line 180

def hide_info_boxes
end

#hide_result_banners

Hide all the results banners



239
240
# File 'docs/6_Contest_02_Visual.rb', line 239

def hide_result_banners
end

#lock

Lock the contest scene



75
76
# File 'docs/6_Contest_02_Visual.rb', line 75

def lock
end

#locking? ⇒ Boolean

Tell if the visual are locking the battle update (for transition purpose)

Returns:

  • (Boolean)


69
70
# File 'docs/6_Contest_02_Visual.rb', line 69

def locking?
end

#open_curtains

Show the curtains opening animation



166
167
# File 'docs/6_Contest_02_Visual.rb', line 166

def open_curtains
end

#refresh_info_boxes

Refresh all the info boxes with the new play order



187
188
# File 'docs/6_Contest_02_Visual.rb', line 187

def refresh_info_boxes
end

#reset_enthousiasm

Reset the enthousiasm shown by the judge



208
209
# File 'docs/6_Contest_02_Visual.rb', line 208

def reset_enthousiasm
end

#scene_update_proc { ... }

Note:

this function raise if the visual are not locked

Display animation & stuff like that by updating the scene

Yields:

  • [] yield the given block without argument



80
81
# File 'docs/6_Contest_02_Visual.rb', line 80

def scene_update_proc
end

#show_banner_places_animations

Show the places of the contestants in the result banners



248
249
# File 'docs/6_Contest_02_Visual.rb', line 248

def show_banner_places_animations
end

#show_condition_star_animation(contestant)

Show the animation of a condition star appearing on the info box of a contestant

Parameters:

  • contestant (Contest::ContestCreature)


196
197
# File 'docs/6_Contest_02_Visual.rb', line 196

def show_condition_star_animation(contestant)
end

#show_effect_icon_animation(contestant)

Show the animation of an effect icon appearing on the info box of a contestant

Parameters:

  • contestant (Contest::ContestCreature)


200
201
# File 'docs/6_Contest_02_Visual.rb', line 200

def show_effect_icon_animation(contestant)
end

#show_info_boxes(no_selection: false)

Show all the info boxes

Parameters:

  • no_selection (Boolean) (defaults to: false) —

    whether to avoid selecting the current contestant



184
185
# File 'docs/6_Contest_02_Visual.rb', line 184

def show_info_boxes(no_selection: false)
end

#show_mega_animation(contestant)

Show the creature mega evolution animation

Parameters:



262
263
# File 'docs/6_Contest_02_Visual.rb', line 262

def show_mega_animation(contestant)
end

#show_move_animation(user, move)

Make a move animation

Parameters:



171
172
# File 'docs/6_Contest_02_Visual.rb', line 171

def show_move_animation(user, move)
end

#show_result_banners

Show all the banners



236
237
# File 'docs/6_Contest_02_Visual.rb', line 236

def show_result_banners
end

#show_score_animation

Show the score animation of all the banners



245
246
# File 'docs/6_Contest_02_Visual.rb', line 245

def show_score_animation
end

#show_skill_choice ⇒ Contest::Move

Method that show the skill choice and store it inside an instance variable

Returns:



149
150
# File 'docs/6_Contest_02_Visual.rb', line 149

def show_skill_choice
end

#show_winner_animation

Show the winner animation



251
252
# File 'docs/6_Contest_02_Visual.rb', line 251

def show_winner_animation
end

#snap_to_bitmaps ⇒ Array<Texture>

Snap all viewports to bitmap

Returns:



87
88
# File 'docs/6_Contest_02_Visual.rb', line 87

def snap_to_bitmaps
end

#start_center_animation

Note:

This method is used only in Visual3D

Define the translation to the center of the Screen



91
92
# File 'docs/6_Contest_02_Visual.rb', line 91

def start_center_animation
end

#to_s Also known as: inspect

Safe to_s & inspect



59
60
# File 'docs/6_Contest_02_Visual.rb', line 59

def to_s
end

#unlock

Unlock the contest scene



72
73
# File 'docs/6_Contest_02_Visual.rb', line 72

def unlock
end

#update

Update the visuals



63
64
# File 'docs/6_Contest_02_Visual.rb', line 63

def update
end

#wait_for_animation

Wait for all animations to end (non parallel ones)



83
84
# File 'docs/6_Contest_02_Visual.rb', line 83

def wait_for_animation
end

#winner_message(contestant)

Show the contest winner message



254
255
# File 'docs/6_Contest_02_Visual.rb', line 254

def winner_message(contestant)
end