Class: Battle::Visual3D
Overview
Class that manage all the things that are visually seen on the screen used only when BATTLECAMERA is true
Defined Under Namespace
Modules: Transition3D Classes: CameraPositionner, CameraTranslationData
Constant Summary collapse
- HALF_WIDTH =
Return half of the width of the default resolution
160- HALF_HEIGHT =
Return half of the height of the default resolution
120- CAMERA_CAPTURE_POSITION =
Coordinates for the camera depending of the target
{solo: [65, -10, 2], base_position_0: [65, -10, 2], base_position_1: [65, -10, 2]}
- CAMERA_TRANSLATION =
Default Margin_X : 64 (32px on each side), Margin_Y : 60 (30px on each side) This constant handles the camera translation steps during idle animation -9 20 1 => is when the camera is centered on your creature (but it's not the real center of the screen, 0 0 1 is the real one) at default zoom (z = 1)
[CameraTranslationData.new(0, -21, 0, 29, 1, 0.9, 2, 1), CameraTranslationData.new(-21, 15, 29, -19, 0.9, 1, 3, 1.25), CameraTranslationData.new(15, -44, -19, 6, 1, 1, 2.5, 1.5), CameraTranslationData.new(-44, 0, 6, 0, 1, 1, 1.4, 2)]
- CAMERA_CENTER =
Duration and target coordinates for centering the camera (x/y/z are not used, only CC_DURATION)
[-9, 20, 1, 0.3]
- CC_DURATION =
Named index for CAMERA_CENTER duration
3- CAMERA_ZOOM_COORDINATES =
Camera zoom coordinates indexed by [vs_type][bank][position] vs_type: 1 = 1v1, 2 = 2v2, 3 = 3v3
{1 => {1 => [[56, -30, 1.4]], 0 => [[-40, 13, 1.2]]}, 2 => {1 => [[44, -33, 1.4], [68, -27, 1.4]], 0 => [[-52, 10, 1.2], [-28, 16, 1.2]]}, 3 => {1 => [[30, -42, 1.4], [56, -30, 1.4], [82, -18, 1.4]], 0 => [[-66, 1, 1.2], [-40, 13, 1.2], [-14, 25, 1.2]]}}
Constants inherited from Visual
Battle::Visual::BAG_PARTY_POSITIONS
Instance Attribute Summary collapse
-
#camera ⇒ Fake3D::Camera
Camera of the battle.
-
#camera_positionner ⇒ Fake3D::Camera
Camera Positionner of the camera.
-
#sprites3D
Array of the sprite applied to the camera.
Attributes inherited from Visual
#animations, #background, #parallel_animations, #to_dispose, #viewport, #viewport_sub
Class Method Summary collapse
-
.transition_resource_hash ⇒ Hash{ Integer => Symbol }
Return the transition resource type hash (3D).
Instance Method Summary collapse
-
#camera_translation_coordinates(translation, index) ⇒ CameraTranslationData
Compute start and final coordinates for a camera translation step.
-
#camera_zoom_1v1(bank) ⇒ Array(Float,Float,Float)
Coordinates to zoom for the camera in 1v1.
-
#camera_zoom_2v2(bank, position) ⇒ Array(Float,Float,Float)
Coordinates to zoom for the camera in 2v2.
-
#camera_zoom_3v3(bank, position) ⇒ Array<Float>
Coordinates to zoom for the camera in 3v3.
-
#center_target(bank, position)
Center the camera on one of the sprite.
-
#create_cameras
Create the camera and the camera_positionner.
-
#create_viewport
Create the Visual viewport.
-
#dark_tone_animation
Start a tone animation on all the elements behind the Battlers.
-
#initialize(scene) ⇒ Visual3D
constructor
Create a new visual instance.
-
#no_movement_duration
Time without moving at the beginning of start_camera_animation.
-
#reset_tone_animation
Reset the tone of the background.
-
#show_bait_mud_animation(target_pokemon, bait_mud)
Show the bait or mud throw animation if Safari Battle.
-
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation.
-
#show_catch_blocked_animation(target_pokemon, ball)
Show the catch blocked animation (ball thrown then bounces back).
-
#start_camera_animation
Define the camera animation across the Battle Scene.
-
#start_center_animation
Define the translation to the center of the Screen.
-
#stop_camera
delete all cameras.
-
#update
Update the visuals.
-
#update_camera
Update the position of the camera.
Methods inherited from Visual
#battler_sprite, #dispose, #heal_status_remove_tone, #hide_ability, #hide_info_bar, #hide_info_bars, #hide_team_info, #lock, #locking?, #refresh_info_bar, register_transition_resource, #scene_update_proc, #set_info_state, #shift_battler_sprite, #show_ability, #show_exp_distribution, #show_hp_animations, #show_info_bar, #show_info_bars, #show_item, #show_item_choice, #show_kos, #show_mega_animation, #show_move_animation, #show_player_choice, #show_pokemon_choice, #show_pre_transition, #show_rmxp_animation, #show_skill_choice, #show_stat_animation, #show_status_animation, #show_switch_form_animation, #show_target_choice, #show_team_info, #show_transition, #show_transition_battle_end, #show_weather_animation, #snap_to_bitmaps, #spc_show_message, #start_weather_animation, #store_battler_sprite, #to_s, transition_resource_type_for, #unlock, #wait_for_animation
Constructor Details
#initialize(scene) ⇒ Visual3D
Create a new visual instance
1532 1533 |
# File 'docs/5_Battle_02_Visual.rb', line 1532 def initialize(scene) end |
Instance Attribute Details
#camera ⇒ Fake3D::Camera
Camera of the battle
1524 1525 1526 |
# File 'docs/5_Battle_02_Visual.rb', line 1524 def camera @camera end |
#camera_positionner ⇒ Fake3D::Camera
Camera Positionner of the camera
1527 1528 1529 |
# File 'docs/5_Battle_02_Visual.rb', line 1527 def camera_positionner @camera_positionner end |
#sprites3D
Returns Array of the sprite applied to the camera.
1529 1530 1531 |
# File 'docs/5_Battle_02_Visual.rb', line 1529 def sprites3D @sprites3D end |
Class Method Details
.transition_resource_hash ⇒ Hash{ Integer => Symbol }
Return the transition resource type hash (3D)
1568 1569 |
# File 'docs/5_Battle_02_Visual.rb', line 1568 def transition_resource_hash end |
Instance Method Details
#camera_translation_coordinates(translation, index) ⇒ CameraTranslationData
Compute start and final coordinates for a camera translation step
1788 1789 |
# File 'docs/5_Battle_02_Visual.rb', line 1788 def camera_translation_coordinates(translation, index) end |
#camera_zoom_1v1(bank) ⇒ Array(Float,Float,Float)
Coordinates to zoom for the camera in 1v1
1807 1808 |
# File 'docs/5_Battle_02_Visual.rb', line 1807 def camera_zoom_1v1(bank) end |
#camera_zoom_2v2(bank, position) ⇒ Array(Float,Float,Float)
Coordinates to zoom for the camera in 2v2
1813 1814 |
# File 'docs/5_Battle_02_Visual.rb', line 1813 def camera_zoom_2v2(bank, position) end |
#camera_zoom_3v3(bank, position) ⇒ Array<Float>
Coordinates to zoom for the camera in 3v3
1819 1820 |
# File 'docs/5_Battle_02_Visual.rb', line 1819 def camera_zoom_3v3(bank, position) end |
#center_target(bank, position)
Center the camera on one of the sprite
1802 1803 |
# File 'docs/5_Battle_02_Visual.rb', line 1802 def center_target(bank, position) end |
#create_cameras
Create the camera and the camera_positionner
1538 1539 |
# File 'docs/5_Battle_02_Visual.rb', line 1538 def create_cameras end |
#create_viewport
Create the Visual viewport
1535 1536 |
# File 'docs/5_Battle_02_Visual.rb', line 1535 def end |
#dark_tone_animation
Start a tone animation on all the elements behind the Battlers
1831 1832 |
# File 'docs/5_Battle_02_Visual.rb', line 1831 def dark_tone_animation end |
#no_movement_duration
Time without moving at the beginning of start_camera_animation
1794 1795 |
# File 'docs/5_Battle_02_Visual.rb', line 1794 def no_movement_duration end |
#reset_tone_animation
Reset the tone of the background
1834 1835 |
# File 'docs/5_Battle_02_Visual.rb', line 1834 def reset_tone_animation end |
#show_bait_mud_animation(target_pokemon, bait_mud)
Show the bait or mud throw animation if Safari Battle
1706 1707 |
# File 'docs/5_Battle_02_Visual.rb', line 1706 def show_bait_mud_animation(target_pokemon, bait_mud) end |
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation
1605 1606 |
# File 'docs/5_Battle_02_Visual.rb', line 1605 def show_catch_animation(target_pokemon, ball, nb_bounce, caught) end |
#show_catch_blocked_animation(target_pokemon, ball)
Show the catch blocked animation (ball thrown then bounces back)
1610 1611 |
# File 'docs/5_Battle_02_Visual.rb', line 1610 def show_catch_blocked_animation(target_pokemon, ball) end |
#start_camera_animation
Define the camera animation across the Battle Scene
1782 1783 |
# File 'docs/5_Battle_02_Visual.rb', line 1782 def start_camera_animation end |
#start_center_animation
Define the translation to the center of the Screen
1791 1792 |
# File 'docs/5_Battle_02_Visual.rb', line 1791 def start_center_animation end |
#stop_camera
delete all cameras
1797 1798 |
# File 'docs/5_Battle_02_Visual.rb', line 1797 def stop_camera end |
#update
Update the visuals
1541 1542 |
# File 'docs/5_Battle_02_Visual.rb', line 1541 def update end |
#update_camera
Update the position of the camera
1779 1780 |
# File 'docs/5_Battle_02_Visual.rb', line 1779 def update_camera end |