└── addons └── phantom_camera ├── assets ├── PhantomCameraBtnPrimaryDefault.png ├── PhantomCameraBtnPrimaryDefault.png.import ├── PhantomCameraBtnPrimaryHover.png └── PhantomCameraBtnPrimaryHover.png.import ├── examples ├── credits.txt ├── example_scenes │ ├── 2D-4.3 │ │ ├── 2d_example_scene.tscn │ │ ├── 2d_follow_framed_example_scene.tscn │ │ ├── 2d_follow_group_example_scene.tscn │ │ ├── 2d_follow_path_example_scene.tscn │ │ ├── 2d_limit_example_scene.tscn │ │ ├── 2d_noise_example_scene.tscn │ │ └── 2d_tweening_example_scene.tscn │ ├── 2D │ │ ├── 2d_example_scene.tscn │ │ ├── 2d_follow_framed_example_scene.tscn │ │ ├── 2d_follow_group_example_scene.tscn │ │ ├── 2d_follow_path_example_scene.tscn │ │ ├── 2d_limit_example_scene.tscn │ │ ├── 2d_tweening_example_scene.tscn │ │ └── sub_scenes │ │ │ └── playable_character_2d.tscn │ ├── 3D-4.4 │ │ ├── 3d_example_scene.tscn │ │ ├── 3d_follow_framed_example_scene.tscn │ │ ├── 3d_follow_glued_example_scene.tscn │ │ ├── 3d_follow_group_example_scene.tscn │ │ ├── 3d_follow_path_example_scene.tscn │ │ ├── 3d_follow_simple_example_scene.tscn │ │ ├── 3d_follow_third_person_attribtues_example_scene.tscn │ │ ├── 3d_follow_third_person_example_scene.tscn │ │ ├── 3d_look_at_example_scene.tscn │ │ ├── 3d_noise_example_scene.tscn │ │ ├── 3d_tweening_example_scene.tscn │ │ └── sub_scenes │ │ │ ├── playable_character_3d.tscn │ │ │ └── playable_character_third_person_3d.tscn │ └── 3D │ │ ├── 3d_example_scene.tscn │ │ ├── 3d_follow_framed_example_scene.tscn │ │ ├── 3d_follow_glued_example_scene.tscn │ │ ├── 3d_follow_group_example_scene.tscn │ │ ├── 3d_follow_path_example_scene.tscn │ │ ├── 3d_follow_simple_example_scene.tscn │ │ ├── 3d_follow_third_person_attribtues_example_scene.tscn │ │ ├── 3d_follow_third_person_example_scene.tscn │ │ ├── 3d_look_at_example_scene.tscn │ │ ├── 3d_noise_example_scene.tscn │ │ ├── 3d_tweening_example_scene.tscn │ │ └── sub_scenes │ │ ├── playable_character_3d.tscn │ │ └── playable_character_third_person_3d.tscn ├── models │ └── 3d_cube_dark.tscn ├── resources │ └── tween │ │ ├── fixed_camera_tween.tres │ │ ├── inventory_phantom_camera_2d_tween.tres │ │ ├── item_focus_phantom_camera_2d_tween.tres │ │ ├── player_phantom_camera_2d_tween.tres │ │ └── player_phantom_camera_3d_tween.tres ├── scripts │ ├── 2D │ │ ├── 2d_room_limit_tween.gd │ │ ├── 2d_room_limit_tween.gd.uid │ │ ├── 2d_room_limit_tween_4.3.gd │ │ ├── 2d_room_limit_tween_4.3.gd.uid │ │ ├── 2d_trigger_area.gd │ │ ├── 2d_trigger_area.gd.uid │ │ ├── player_character_body_2d.gd │ │ ├── player_character_body_2d.gd.uid │ │ ├── player_character_body_2d_4.3.gd │ │ └── player_character_body_2d_4.3.gd.uid │ └── 3D │ │ ├── 3d_trigger_area.gd │ │ ├── 3d_trigger_area.gd.uid │ │ ├── npc.gd │ │ ├── npc.gd.uid │ │ ├── path_follow.gd │ │ ├── path_follow.gd.uid │ │ ├── player_controller.gd │ │ ├── player_controller.gd.uid │ │ ├── player_controller_4.4.gd │ │ ├── player_controller_4.4.gd.uid │ │ ├── player_controller_first_person.gd │ │ ├── player_controller_first_person.gd.uid │ │ ├── player_controller_first_person_4.4.gd │ │ ├── player_controller_first_person_4.4.gd.uid │ │ ├── player_controller_third_person.gd │ │ ├── player_controller_third_person.gd.uid │ │ ├── player_controller_third_person_4.4.gd │ │ └── player_controller_third_person_4.4.gd.uid ├── textures │ ├── 2D │ │ ├── inventory_container.png │ │ ├── inventory_container.png.import │ │ ├── level_spritesheet.png │ │ ├── level_spritesheet.png.import │ │ ├── phantom_camera_2d_sprite.png │ │ ├── phantom_camera_2d_sprite.png.import │ │ ├── player_sprite.svg │ │ ├── player_sprite.svg.import │ │ ├── sign_prompt.png │ │ └── sign_prompt.png.import │ └── 3D │ │ ├── checker_pattern_dark.png │ │ ├── checker_pattern_dark.png.import │ │ ├── target.png │ │ └── target.png.import └── ui │ ├── ui_inventory.tscn │ └── ui_sign.tscn ├── fonts ├── Nunito-Black.ttf ├── Nunito-Black.ttf.import ├── Nunito-Regular.ttf └── Nunito-Regular.ttf.import ├── icons ├── misc │ ├── PriorityOverride.svg │ └── PriorityOverride.svg.import ├── phantom_camera_2d.svg ├── phantom_camera_2d.svg.import ├── phantom_camera_3d.svg ├── phantom_camera_3d.svg.import ├── phantom_camera_camera_3d_resource.svg ├── phantom_camera_camera_3d_resource.svg.import ├── phantom_camera_gizmo.svg ├── phantom_camera_gizmo.svg.import ├── phantom_camera_glow_logo.png ├── phantom_camera_glow_logo.png.import ├── phantom_camera_host.svg ├── phantom_camera_host.svg.import ├── phantom_camera_logo.png ├── phantom_camera_logo.png.import ├── phantom_camera_noise_emitter_2d.svg ├── phantom_camera_noise_emitter_2d.svg.import ├── phantom_camera_noise_emitter_3d.svg ├── phantom_camera_noise_emitter_3d.svg.import ├── phantom_camera_noise_emitter_gizmo.svg ├── phantom_camera_noise_emitter_gizmo.svg.import ├── phantom_camera_noise_resource.svg ├── phantom_camera_noise_resource.svg.import ├── phantom_camera_tween.svg ├── phantom_camera_tween.svg.import ├── phantom_camera_updater_panel_icon.svg ├── phantom_camera_updater_panel_icon.svg.import ├── viewfinder │ ├── Camera2DIcon.svg │ ├── Camera2DIcon.svg.import │ ├── Camera3DIcon.svg │ ├── Camera3DIcon.svg.import │ ├── SceneTypesIcon.svg │ ├── SceneTypesIcon.svg.import │ ├── Select.svg │ └── Select.svg.import ├── warning.svg └── warning.svg.import ├── inspector ├── phantom_camera_inspector_plugin.gd └── phantom_camera_inspector_plugin.gd.uid ├── panel ├── editor.gd.uid ├── editor.tscn ├── updater │ ├── download_update_panel.tscn │ └── update_button.tscn └── viewfinder │ ├── deadzone_style_box.tres │ ├── host_list │ ├── host_list.tscn │ ├── host_list_item.tscn │ └── host_list_item_group.tres │ └── viewfinder_panel.tscn ├── plugin.cfg ├── plugin.gd ├── plugin.gd.uid ├── scripts ├── gizmos │ ├── phantom_camera_3d_gizmo.gd │ ├── phantom_camera_3d_gizmo.gd.uid │ ├── phantom_camera_3d_gizmo_plugin.gd │ ├── phantom_camera_3d_gizmo_plugin.gd.uid │ ├── phantom_camera_noise_emitter_gizmo_plugin_3d.gd │ └── phantom_camera_noise_emitter_gizmo_plugin_3d.gd.uid ├── managers │ ├── PhantomCameraManager.cs │ ├── PhantomCameraManager.cs.uid │ ├── phantom_camera_manager.gd │ └── phantom_camera_manager.gd.uid ├── panel │ ├── editor.gd │ ├── editor.gd.uid │ ├── updater │ │ ├── download_update_panel.gd │ │ ├── download_update_panel.gd.uid │ │ ├── update_button.gd │ │ ├── update_button.gd.uid │ │ ├── updater_constants.gd │ │ └── updater_constants.gd.uid │ └── viewfinder │ │ ├── host_list.gd │ │ ├── host_list.gd.uid │ │ ├── host_list_item.gd │ │ ├── host_list_item.gd.uid │ │ ├── viewfinder.gd │ │ └── viewfinder.gd.uid ├── phantom_camera │ ├── PhantomCamera.cs │ ├── PhantomCamera.cs.uid │ ├── PhantomCamera2D.cs │ ├── PhantomCamera2D.cs.uid │ ├── PhantomCamera3D.cs │ ├── PhantomCamera3D.cs.uid │ ├── PhantomCameraNoiseEmitter2D.cs │ ├── PhantomCameraNoiseEmitter2D.cs.uid │ ├── PhantomCameraNoiseEmitter3D.cs │ ├── PhantomCameraNoiseEmitter3D.cs.uid │ ├── phantom_camera_2d.gd │ ├── phantom_camera_2d.gd.uid │ ├── phantom_camera_3d.gd │ ├── phantom_camera_3d.gd.uid │ ├── phantom_camera_constants.gd │ ├── phantom_camera_constants.gd.uid │ ├── phantom_camera_noise_emitter_2d.gd │ ├── phantom_camera_noise_emitter_2d.gd.uid │ ├── phantom_camera_noise_emitter_3d.gd │ └── phantom_camera_noise_emitter_3d.gd.uid ├── phantom_camera_host │ ├── PhantomCameraHost.cs │ ├── PhantomCameraHost.cs.uid │ ├── phantom_camera_host.gd │ └── phantom_camera_host.gd.uid └── resources │ ├── Camera3DResource.cs │ ├── Camera3DResource.cs.uid │ ├── PhantomCameraNoise2D.cs │ ├── PhantomCameraNoise2D.cs.uid │ ├── PhantomCameraNoise3D.cs │ ├── PhantomCameraNoise3D.cs.uid │ ├── PhantomCameraTween.cs │ ├── PhantomCameraTween.cs.uid │ ├── camera_3d_resource.gd │ ├── camera_3d_resource.gd.uid │ ├── phantom_camera_noise_2d.gd │ ├── phantom_camera_noise_2d.gd.uid │ ├── phantom_camera_noise_3d.gd │ ├── phantom_camera_noise_3d.gd.uid │ ├── tween_resource.gd │ └── tween_resource.gd.uid └── themes ├── button_focus.tres ├── button_hover.tres ├── button_normal.tres └── theme.tres /addons/phantom_camera/assets/PhantomCameraBtnPrimaryDefault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/assets/PhantomCameraBtnPrimaryDefault.png -------------------------------------------------------------------------------- /addons/phantom_camera/assets/PhantomCameraBtnPrimaryDefault.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://censw3w53gldn" 6 | path="res://.godot/imported/PhantomCameraBtnPrimaryDefault.png-fcf3696b583a82b1078609a5bfd648f5.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/assets/PhantomCameraBtnPrimaryDefault.png" 14 | dest_files=["res://.godot/imported/PhantomCameraBtnPrimaryDefault.png-fcf3696b583a82b1078609a5bfd648f5.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/assets/PhantomCameraBtnPrimaryHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/assets/PhantomCameraBtnPrimaryHover.png -------------------------------------------------------------------------------- /addons/phantom_camera/assets/PhantomCameraBtnPrimaryHover.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://pvr8mbvl1onm" 6 | path="res://.godot/imported/PhantomCameraBtnPrimaryHover.png-3d2e4d225f6a86ce8a9c981ee7926a16.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/assets/PhantomCameraBtnPrimaryHover.png" 14 | dest_files=["res://.godot/imported/PhantomCameraBtnPrimaryHover.png-3d2e4d225f6a86ce8a9c981ee7926a16.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/credits.txt: -------------------------------------------------------------------------------- 1 | ##################### 2 | EXAMPLE ASSET CREDITS 3 | ##################### 4 | 5 | # level_spritesheet 6 | https://opengameart.org/content/a-platformer-in-the-forest 7 | https://opengameart.org/users/buch 8 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/example_scenes/2D/sub_scenes/playable_character_2d.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=3 uid="uid://7kh0xydx0b1o"] 2 | 3 | [ext_resource type="Script" uid="uid://cb46ypjv5p72s" path="res://addons/phantom_camera/examples/scripts/2D/player_character_body_2d.gd" id="1_jnc14"] 4 | [ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="2_62b2n"] 5 | [ext_resource type="Texture2D" uid="uid://cscjjt55iw2cu" path="res://addons/phantom_camera/examples/textures/2D/player_sprite.svg" id="2_yr8cm"] 6 | [ext_resource type="Script" uid="uid://bhexx6mj1xv3q" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd" id="4_rloon"] 7 | [ext_resource type="Resource" uid="uid://cecrnq0wnkexh" path="res://addons/phantom_camera/examples/resources/tween/item_focus_phantom_camera_2d_tween.tres" id="5_4iyk1"] 8 | [ext_resource type="Resource" uid="uid://cllveybboaqk5" path="res://addons/phantom_camera/examples/resources/tween/inventory_phantom_camera_2d_tween.tres" id="6_2h6fv"] 9 | 10 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5hryl"] 11 | bg_color = Color(0.85098, 0.894118, 0.937255, 1) 12 | border_width_left = 2 13 | border_width_top = 2 14 | border_width_right = 2 15 | border_width_bottom = 2 16 | border_color = Color(0.113725, 0.113725, 0.113725, 1) 17 | corner_radius_top_left = 7 18 | corner_radius_top_right = 7 19 | corner_radius_bottom_right = 7 20 | corner_radius_bottom_left = 7 21 | 22 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_xj4ar"] 23 | size = Vector2(64, 57) 24 | 25 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_18i13"] 26 | size = Vector2(64, 57) 27 | 28 | [node name="CharacterBody2D" type="CharacterBody2D"] 29 | script = ExtResource("1_jnc14") 30 | 31 | [node name="DarkOverlay" type="ColorRect" parent="."] 32 | unique_name_in_owner = true 33 | visible = false 34 | anchors_preset = 8 35 | anchor_left = 0.5 36 | anchor_top = 0.5 37 | anchor_right = 0.5 38 | anchor_bottom = 0.5 39 | offset_left = -1000.0 40 | offset_top = -1000.0 41 | offset_right = 1000.0 42 | offset_bottom = 1000.0 43 | grow_horizontal = 2 44 | grow_vertical = 2 45 | color = Color(0, 0, 0, 0.615686) 46 | 47 | [node name="PlayerVisuals" type="Node2D" parent="."] 48 | unique_name_in_owner = true 49 | 50 | [node name="PlayerSprite" type="Sprite2D" parent="PlayerVisuals"] 51 | unique_name_in_owner = true 52 | scale = Vector2(0.5, 0.5) 53 | texture = ExtResource("2_yr8cm") 54 | 55 | [node name="InteractionPrompt" type="Panel" parent="PlayerVisuals"] 56 | unique_name_in_owner = true 57 | visible = false 58 | anchors_preset = 7 59 | anchor_left = 0.5 60 | anchor_top = 1.0 61 | anchor_right = 0.5 62 | anchor_bottom = 1.0 63 | offset_left = -16.0 64 | offset_top = -66.0 65 | offset_right = 16.0 66 | offset_bottom = -34.0 67 | grow_horizontal = 2 68 | grow_vertical = 0 69 | size_flags_vertical = 0 70 | theme_override_styles/panel = SubResource("StyleBoxFlat_5hryl") 71 | 72 | [node name="Label" type="Label" parent="PlayerVisuals/InteractionPrompt"] 73 | layout_mode = 1 74 | anchors_preset = 15 75 | anchor_right = 1.0 76 | anchor_bottom = 1.0 77 | offset_top = -3.0 78 | offset_bottom = 5.0 79 | grow_horizontal = 2 80 | grow_vertical = 2 81 | theme_override_colors/font_color = Color(0, 0, 0, 1) 82 | theme_override_fonts/font = ExtResource("2_62b2n") 83 | theme_override_font_sizes/font_size = 26 84 | text = "F" 85 | horizontal_alignment = 1 86 | vertical_alignment = 1 87 | 88 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 89 | position = Vector2(0, -0.5) 90 | shape = SubResource("RectangleShape2D_xj4ar") 91 | 92 | [node name="PlayerArea2D" type="Area2D" parent="."] 93 | unique_name_in_owner = true 94 | collision_layer = 2 95 | collision_mask = 2 96 | priority = 20 97 | 98 | [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerArea2D"] 99 | position = Vector2(0, -0.5) 100 | shape = SubResource("RectangleShape2D_18i13") 101 | 102 | [node name="ItemFocusPhantomCamera2D" type="Node2D" parent="."] 103 | unique_name_in_owner = true 104 | position = Vector2(0, -122) 105 | script = ExtResource("4_rloon") 106 | zoom = Vector2(2, 2) 107 | frame_preview = false 108 | tween_resource = ExtResource("5_4iyk1") 109 | follow_damping_value = Vector2(0, 0) 110 | draw_limits = true 111 | 112 | [node name="InventoryPhantomCamera2D" type="Node2D" parent="."] 113 | unique_name_in_owner = true 114 | position = Vector2(-183, -5) 115 | script = ExtResource("4_rloon") 116 | zoom = Vector2(2.5, 2.5) 117 | frame_preview = false 118 | tween_resource = ExtResource("6_2h6fv") 119 | follow_damping_value = Vector2(0, 0) 120 | draw_limits = true 121 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/example_scenes/3D-4.4/sub_scenes/playable_character_3d.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=3 uid="uid://cb83in8f0tbb1"] 2 | 3 | [ext_resource type="Script" uid="uid://tgv6xpi88sd0" path="res://addons/phantom_camera/examples/scripts/3D/player_controller_4.4.gd" id="1_pl87s"] 4 | 5 | [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_8efyg"] 6 | 7 | [sub_resource type="CapsuleMesh" id="CapsuleMesh_2cfaw"] 8 | 9 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_r3ldp"] 10 | albedo_color = Color(0.988235, 0.498039, 0.498039, 1) 11 | 12 | [node name="PlayerCharacterBody3D2" type="CharacterBody3D"] 13 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.083587, 0.507, 2.05493) 14 | script = ExtResource("1_pl87s") 15 | metadata/_edit_group_ = true 16 | 17 | [node name="PlayerArea3D" type="Area3D" parent="."] 18 | 19 | [node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerArea3D"] 20 | shape = SubResource("CapsuleShape3D_8efyg") 21 | 22 | [node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="."] 23 | shape = SubResource("CapsuleShape3D_8efyg") 24 | 25 | [node name="PlayerVisual" type="Node3D" parent="."] 26 | unique_name_in_owner = true 27 | 28 | [node name="PlayerModel" type="MeshInstance3D" parent="PlayerVisual"] 29 | mesh = SubResource("CapsuleMesh_2cfaw") 30 | skeleton = NodePath("../..") 31 | surface_material_override/0 = SubResource("StandardMaterial3D_r3ldp") 32 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/example_scenes/3D-4.4/sub_scenes/playable_character_third_person_3d.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=3 uid="uid://bhd1kwv2fwj1y"] 2 | 3 | [ext_resource type="Script" uid="uid://bkr71vxe2t18n" path="res://addons/phantom_camera/examples/scripts/3D/player_controller_third_person_4.4.gd" id="1_skas8"] 4 | 5 | [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_s61dn"] 6 | 7 | [sub_resource type="CapsuleMesh" id="CapsuleMesh_47f0o"] 8 | 9 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mv4do"] 10 | albedo_color = Color(0.988235, 0.498039, 0.498039, 1) 11 | 12 | [sub_resource type="PrismMesh" id="PrismMesh_wg1x3"] 13 | size = Vector3(0.5, 0.5, 0.3) 14 | 15 | [node name="PlayerCharacterBody3D" type="CharacterBody3D"] 16 | transform = Transform3D(0.999903, 0.0139622, 0, -0.0139622, 0.999903, 0, 0, 0, 1, -0.0194088, 0.506884, -0.0163251) 17 | collision_layer = 2 18 | script = ExtResource("1_skas8") 19 | metadata/_edit_group_ = true 20 | 21 | [node name="PlayerArea3D" type="Area3D" parent="."] 22 | 23 | [node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerArea3D"] 24 | shape = SubResource("CapsuleShape3D_s61dn") 25 | 26 | [node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="."] 27 | shape = SubResource("CapsuleShape3D_s61dn") 28 | 29 | [node name="PlayerVisual" type="Node3D" parent="."] 30 | unique_name_in_owner = true 31 | 32 | [node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="PlayerVisual"] 33 | transform = Transform3D(1, 0, 0, 0, 1, 4.65661e-10, 0, 0, 1, 0, 0, 0) 34 | mesh = SubResource("CapsuleMesh_47f0o") 35 | skeleton = NodePath("../..") 36 | surface_material_override/0 = SubResource("StandardMaterial3D_mv4do") 37 | 38 | [node name="PlayerDirection" type="MeshInstance3D" parent="PlayerVisual"] 39 | unique_name_in_owner = true 40 | transform = Transform3D(1, 0, 0, -9.31323e-10, 1, 4.65661e-10, 2.98023e-08, 0, 1, -0.0156226, 1.08631, 0) 41 | mesh = SubResource("PrismMesh_wg1x3") 42 | skeleton = NodePath("../..") 43 | surface_material_override/0 = SubResource("StandardMaterial3D_mv4do") 44 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/example_scenes/3D/sub_scenes/playable_character_3d.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=3 uid="uid://bulsh7s0ibmao"] 2 | 3 | [ext_resource type="Script" uid="uid://dut3e76k2c71n" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="1_6hh6c"] 4 | 5 | [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_8efyg"] 6 | 7 | [sub_resource type="CapsuleMesh" id="CapsuleMesh_2cfaw"] 8 | 9 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_r3ldp"] 10 | albedo_color = Color(0.988235, 0.498039, 0.498039, 1) 11 | 12 | [node name="PlayerCharacterBody3D2" type="CharacterBody3D"] 13 | script = ExtResource("1_6hh6c") 14 | metadata/_edit_group_ = true 15 | 16 | [node name="PlayerArea3D" type="Area3D" parent="."] 17 | 18 | [node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerArea3D"] 19 | shape = SubResource("CapsuleShape3D_8efyg") 20 | 21 | [node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="."] 22 | shape = SubResource("CapsuleShape3D_8efyg") 23 | 24 | [node name="PlayerVisual" type="Node3D" parent="."] 25 | unique_name_in_owner = true 26 | 27 | [node name="PlayerModel" type="MeshInstance3D" parent="PlayerVisual"] 28 | mesh = SubResource("CapsuleMesh_2cfaw") 29 | skeleton = NodePath("../..") 30 | surface_material_override/0 = SubResource("StandardMaterial3D_r3ldp") 31 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/example_scenes/3D/sub_scenes/playable_character_third_person_3d.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=3 uid="uid://mskcwn1a1v6d"] 2 | 3 | [ext_resource type="Script" uid="uid://34uhyq3cpi67" path="res://addons/phantom_camera/examples/scripts/3D/player_controller_third_person.gd" id="1_0dnfe"] 4 | 5 | [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_s61dn"] 6 | 7 | [sub_resource type="CapsuleMesh" id="CapsuleMesh_47f0o"] 8 | 9 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mv4do"] 10 | albedo_color = Color(0.988235, 0.498039, 0.498039, 1) 11 | 12 | [sub_resource type="PrismMesh" id="PrismMesh_wg1x3"] 13 | size = Vector3(0.5, 0.5, 0.3) 14 | 15 | [node name="PlayerCharacterBody3D" type="CharacterBody3D"] 16 | transform = Transform3D(0.999903, 0.0139622, 0, -0.0139622, 0.999903, 0, 0, 0, 1, 0, 0, 0) 17 | collision_layer = 2 18 | script = ExtResource("1_0dnfe") 19 | metadata/_edit_group_ = true 20 | 21 | [node name="PlayerArea3D" type="Area3D" parent="."] 22 | 23 | [node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerArea3D"] 24 | shape = SubResource("CapsuleShape3D_s61dn") 25 | 26 | [node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="."] 27 | shape = SubResource("CapsuleShape3D_s61dn") 28 | 29 | [node name="PlayerVisual" type="Node3D" parent="."] 30 | unique_name_in_owner = true 31 | 32 | [node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="PlayerVisual"] 33 | transform = Transform3D(1, 0, 0, 0, 1, 4.65661e-10, 0, 0, 1, 0, 0, 0) 34 | mesh = SubResource("CapsuleMesh_47f0o") 35 | skeleton = NodePath("../..") 36 | surface_material_override/0 = SubResource("StandardMaterial3D_mv4do") 37 | 38 | [node name="PlayerDirection" type="MeshInstance3D" parent="PlayerVisual"] 39 | unique_name_in_owner = true 40 | transform = Transform3D(1, 0, 0, -9.31323e-10, 1, 4.65661e-10, 2.98023e-08, 0, 1, -0.0156226, 1.08631, 0) 41 | mesh = SubResource("PrismMesh_wg1x3") 42 | skeleton = NodePath("../..") 43 | surface_material_override/0 = SubResource("StandardMaterial3D_mv4do") 44 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/models/3d_cube_dark.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://cixlwqycoox8h"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://bj7h2fc5jx4ax" path="res://addons/phantom_camera/examples/textures/3D/checker_pattern_dark.png" id="1_836jx"] 4 | 5 | [sub_resource type="BoxMesh" id="BoxMesh_d24c3"] 6 | 7 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_aox6v"] 8 | albedo_texture = ExtResource("1_836jx") 9 | uv1_triplanar = true 10 | uv1_world_triplanar = true 11 | 12 | [node name="3DPrototypeCube" type="CSGMesh3D"] 13 | use_collision = true 14 | mesh = SubResource("BoxMesh_d24c3") 15 | material = SubResource("StandardMaterial3D_aox6v") 16 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/resources/tween/fixed_camera_tween.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://c1v786g5agaw5"] 2 | 3 | [ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_ptlie"] 4 | 5 | [resource] 6 | script = ExtResource("1_ptlie") 7 | duration = 0.0 8 | transition = 0 9 | ease = 2 10 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/resources/tween/inventory_phantom_camera_2d_tween.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://cllveybboaqk5"] 2 | 3 | [ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_7yoy0"] 4 | 5 | [resource] 6 | script = ExtResource("1_7yoy0") 7 | duration = 0.6 8 | transition = 5 9 | ease = 1 10 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/resources/tween/item_focus_phantom_camera_2d_tween.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://cecrnq0wnkexh"] 2 | 3 | [ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_sq5ls"] 4 | 5 | [resource] 6 | script = ExtResource("1_sq5ls") 7 | duration = 0.6 8 | transition = 8 9 | ease = 1 10 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/resources/tween/player_phantom_camera_2d_tween.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://euybd2w0bax"] 2 | 3 | [ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_by4ei"] 4 | 5 | [resource] 6 | script = ExtResource("1_by4ei") 7 | duration = 0.6 8 | transition = 3 9 | ease = 1 10 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/resources/tween/player_phantom_camera_3d_tween.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://cptfoggk2ok67"] 2 | 3 | [ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_q5tix"] 4 | 5 | [resource] 6 | script = ExtResource("1_q5tix") 7 | duration = 0.6 8 | transition = 3 9 | ease = 2 10 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/2d_room_limit_tween.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | @onready var pcam_room_left: PhantomCamera2D = %RoomLeftPhantomCamera2D 4 | @onready var pcam_room_centre: PhantomCamera2D = %RoomCentrePhantomCamera2D 5 | @onready var pcam_room_right: PhantomCamera2D = %RoomRightPhantomCamera2D 6 | 7 | @onready var player: Node2D = %CharacterBody2D/%PlayerVisuals 8 | 9 | @onready var area_2d_room_left: Area2D = %RoomLeftArea2D 10 | @onready var area_2d_room_centre: Area2D = %RoomCentreArea2D 11 | @onready var area_2d_room_right: Area2D = %RoomRightArea2D 12 | 13 | 14 | func _ready(): 15 | pcam_room_left.set_follow_offset(Vector2(0, -80)) 16 | pcam_room_right.set_follow_offset(Vector2(0, -80)) 17 | 18 | area_2d_room_left.body_entered.connect(_on_body_entered.bind(pcam_room_left)) 19 | area_2d_room_centre.body_entered.connect(_on_body_entered.bind(pcam_room_centre)) 20 | area_2d_room_right.body_entered.connect(_on_body_entered.bind(pcam_room_right)) 21 | 22 | area_2d_room_left.body_exited.connect(_on_body_exited.bind(pcam_room_left)) 23 | area_2d_room_centre.body_exited.connect(_on_body_exited.bind(pcam_room_centre)) 24 | area_2d_room_right.body_exited.connect(_on_body_exited.bind(pcam_room_right)) 25 | 26 | 27 | func _on_body_entered(body: Node2D, pcam: PhantomCamera2D) -> void: 28 | if body == player.get_parent(): 29 | pcam.set_follow_target(player) 30 | pcam.set_priority(20) 31 | 32 | 33 | func _on_body_exited(body: Node2D, pcam: PhantomCamera2D) -> void: 34 | if body == player.get_parent(): 35 | pcam.set_priority(0) 36 | pcam.set_follow_target(null) 37 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/2d_room_limit_tween.gd.uid: -------------------------------------------------------------------------------- 1 | uid://c5yewe1hewu7j 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/2d_room_limit_tween_4.3.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | @onready var pcam_room_left: PhantomCamera2D = %RoomLeftPhantomCamera2D 4 | @onready var pcam_room_centre: PhantomCamera2D = %RoomCentrePhantomCamera2D 5 | @onready var pcam_room_right: PhantomCamera2D = %RoomRightPhantomCamera2D 6 | 7 | @onready var player: Node2D = %CharacterBody2D 8 | 9 | @onready var area_2d_room_left: Area2D = %RoomLeftArea2D 10 | @onready var area_2d_room_centre: Area2D = %RoomCentreArea2D 11 | @onready var area_2d_room_right: Area2D = %RoomRightArea2D 12 | 13 | 14 | func _ready(): 15 | pcam_room_left.set_follow_offset(Vector2(0, -80)) 16 | pcam_room_right.set_follow_offset(Vector2(0, -80)) 17 | 18 | area_2d_room_left.body_entered.connect(_on_body_entered.bind(pcam_room_left)) 19 | area_2d_room_centre.body_entered.connect(_on_body_entered.bind(pcam_room_centre)) 20 | area_2d_room_right.body_entered.connect(_on_body_entered.bind(pcam_room_right)) 21 | 22 | area_2d_room_left.body_exited.connect(_on_body_exited.bind(pcam_room_left)) 23 | area_2d_room_centre.body_exited.connect(_on_body_exited.bind(pcam_room_centre)) 24 | area_2d_room_right.body_exited.connect(_on_body_exited.bind(pcam_room_right)) 25 | 26 | 27 | func _on_body_entered(body: Node2D, pcam: PhantomCamera2D) -> void: 28 | if body == player: 29 | pcam.set_follow_target(player) 30 | pcam.set_priority(20) 31 | 32 | 33 | func _on_body_exited(body: Node2D, pcam: PhantomCamera2D) -> void: 34 | if body == player: 35 | pcam.set_priority(0) 36 | pcam.set_follow_target(null) 37 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/2d_room_limit_tween_4.3.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dtcuvut1eklnd 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/2d_trigger_area.gd: -------------------------------------------------------------------------------- 1 | extends Area2D 2 | 3 | @export var area_pcam: PhantomCamera2D 4 | 5 | func _ready() -> void: 6 | connect("area_entered", _entered_area) 7 | connect("area_exited", _exited_area) 8 | 9 | func _entered_area(area_2d: Area2D) -> void: 10 | if area_2d.get_parent() is CharacterBody2D: 11 | area_pcam.set_priority(20) 12 | 13 | func _exited_area(area_2d: Area2D) -> void: 14 | if area_2d.get_parent() is CharacterBody2D: 15 | area_pcam.set_priority(0) 16 | 17 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/2d_trigger_area.gd.uid: -------------------------------------------------------------------------------- 1 | uid://t8wa4e5y5hcf 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/player_character_body_2d.gd: -------------------------------------------------------------------------------- 1 | extends CharacterBody2D 2 | 3 | @onready var _player_area2d = %PlayerArea2D 4 | @onready var _player_visuals: Node2D = %PlayerVisuals 5 | @onready var _player_sprite: Sprite2D = %PlayerSprite 6 | @onready var _interaction_prompt: Panel = %InteractionPrompt 7 | @onready var _ui_sign: Control 8 | @onready var _dark_overlay: ColorRect = %DarkOverlay 9 | 10 | const KEY_STRINGNAME: StringName = "Key" 11 | const ACTION_STRINGNAME: StringName = "Action" 12 | const INPUT_MOVE_LEFT_STRINGNAME: StringName = "move_left" 13 | const INPUT_MOVE_RIGHT_STRINGNAME: StringName = "move_right" 14 | 15 | const SPEED = 350.0 16 | const JUMP_VELOCITY = -750.0 17 | 18 | # Get the gravity from the project settings to be synced with RigidBody nodes. 19 | var gravity: int = 2400 20 | var _is_interactive: bool 21 | var _can_open_inventory: bool 22 | var _movement_disabled: bool 23 | var tween: Tween 24 | var _interactive_UI: Control 25 | var _active_pcam: PhantomCamera2D 26 | 27 | var _physics_body_trans_last: Transform2D 28 | var _physics_body_trans_current: Transform2D 29 | 30 | enum InteractiveType { 31 | NONE = 0, 32 | ITEM = 1, 33 | INVENTORY = 2, 34 | } 35 | var _interactive_object: InteractiveType = InteractiveType.NONE 36 | 37 | var InputMovementDic: Dictionary = { 38 | INPUT_MOVE_LEFT_STRINGNAME: { 39 | KEY_STRINGNAME: KEY_A, 40 | ACTION_STRINGNAME: INPUT_MOVE_LEFT_STRINGNAME 41 | }, 42 | INPUT_MOVE_RIGHT_STRINGNAME: { 43 | KEY_STRINGNAME: KEY_D, 44 | ACTION_STRINGNAME: INPUT_MOVE_RIGHT_STRINGNAME 45 | }, 46 | } 47 | 48 | 49 | func _ready() -> void: 50 | _player_area2d.body_shape_entered.connect(_show_prompt) 51 | _player_area2d.body_shape_exited.connect(_hide_prompt) 52 | 53 | _ui_sign = owner.get_node("%UISign") 54 | 55 | for input in InputMovementDic: 56 | var key_val = InputMovementDic[input].get(KEY_STRINGNAME) 57 | var action_val = InputMovementDic[input].get(ACTION_STRINGNAME) 58 | 59 | var movement_input = InputEventKey.new() 60 | movement_input.physical_keycode = key_val 61 | InputMap.add_action(action_val) 62 | InputMap.action_add_event(action_val, movement_input) 63 | 64 | _player_visuals.top_level = true 65 | 66 | if Engine.get_version_info().major == 4 and \ 67 | Engine.get_version_info().minor >= 3: 68 | printerr("Please run the other 2D example scenes, in the 2D-4.3 directory, for more up-to-date example setups.") 69 | 70 | 71 | func _unhandled_input(event: InputEvent) -> void: 72 | if _is_interactive: 73 | if Input.is_physical_key_pressed(KEY_F): 74 | if tween: 75 | tween.kill() 76 | 77 | if not _movement_disabled: 78 | tween = get_tree().create_tween() 79 | 80 | _movement_disabled = true 81 | _active_pcam.set_priority(10) 82 | 83 | _show_interactive_node(_interactive_UI) 84 | _interactive_node_logic() 85 | 86 | else: 87 | _hide_interactive_node(_interactive_UI) 88 | _interactive_node_logic() 89 | 90 | 91 | if Input.is_physical_key_pressed(KEY_ESCAPE) and _movement_disabled: 92 | _hide_interactive_node(_interactive_UI) 93 | _interactive_node_logic() 94 | 95 | 96 | func _show_interactive_node(UI: Control) -> void: 97 | UI.modulate.a = 0 98 | UI.visible = true 99 | tween.tween_property(UI, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CIRC) 100 | 101 | 102 | func _hide_interactive_node(UI: Control) -> void: 103 | _movement_disabled = false 104 | _active_pcam.set_priority(0) 105 | UI.visible = false 106 | 107 | 108 | func _interactive_node_logic() -> void: 109 | match _interactive_object: 110 | 2: 111 | if _movement_disabled: 112 | _dark_overlay.set_visible(true) 113 | else: 114 | _dark_overlay.set_visible(false) 115 | 116 | 117 | func _physics_process(delta: float) -> void: 118 | _physics_body_trans_last = _physics_body_trans_current 119 | _physics_body_trans_current = global_transform 120 | 121 | if not is_on_floor(): 122 | velocity.y += gravity * delta 123 | 124 | if Input.is_action_just_pressed("ui_accept") and is_on_floor(): 125 | velocity.y = JUMP_VELOCITY 126 | 127 | if _movement_disabled: return 128 | 129 | var input_dir: = Input.get_axis( 130 | INPUT_MOVE_LEFT_STRINGNAME, 131 | INPUT_MOVE_RIGHT_STRINGNAME 132 | ) 133 | 134 | if input_dir: 135 | velocity.x = input_dir * SPEED 136 | if input_dir > 0: 137 | _player_sprite.set_flip_h(false) 138 | elif input_dir < 0: 139 | _player_sprite.set_flip_h(true) 140 | else: 141 | velocity.x = move_toward(velocity.x, 0, SPEED) 142 | 143 | move_and_slide() 144 | 145 | 146 | func _process(delta) -> void: 147 | _player_visuals.global_position = _physics_body_trans_last.interpolate_with( 148 | _physics_body_trans_current, 149 | Engine.get_physics_interpolation_fraction() 150 | ).origin 151 | 152 | 153 | func _show_prompt(body_rid: RID, body: Node2D, body_shape_index: int, local_shape: int) -> void: 154 | if body is TileMap: 155 | var tile_map: TileMap = body 156 | 157 | var tile_coords: Vector2i = tile_map.get_coords_for_body_rid(body_rid) 158 | var cell_data: TileData = tile_map.get_cell_tile_data(1, tile_coords) 159 | 160 | if cell_data: 161 | var cell_data_type: StringName = cell_data.get_custom_data("Type") 162 | # var cell_global_pos: Vector2 = tile_map.to_global(tile_map.map_to_local(tile_coords)) 163 | _is_interactive = true 164 | _interaction_prompt.set_visible(true) 165 | 166 | match cell_data_type: 167 | "Sign": 168 | _interactive_UI = owner.get_node("%UISign") 169 | _active_pcam = %ItemFocusPhantomCamera2D 170 | _interactive_object = InteractiveType.ITEM 171 | "Inventory": 172 | _interactive_UI = owner.get_node("%UIInventory") 173 | _interactive_object = InteractiveType.INVENTORY 174 | _active_pcam = %InventoryPhantomCamera2D 175 | 176 | 177 | func _hide_prompt(body_rid: RID, body: Node2D, body_shape_index: int, local_shape: int) -> void: 178 | if body is TileMap: 179 | var tile_map: TileMap = body 180 | 181 | var tile_coords: Vector2i = tile_map.get_coords_for_body_rid(body_rid) 182 | var cell_data: TileData = tile_map.get_cell_tile_data(1, tile_coords) 183 | 184 | if cell_data: 185 | _interaction_prompt.set_visible(false) 186 | _is_interactive = false 187 | _interactive_UI = null 188 | _interactive_object = InteractiveType.NONE 189 | _active_pcam = null 190 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/player_character_body_2d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cb46ypjv5p72s 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/player_character_body_2d_4.3.gd: -------------------------------------------------------------------------------- 1 | extends CharacterBody2D 2 | 3 | @onready var _player_area2d = %PlayerArea2D 4 | @onready var _player_visuals: Node2D = %PlayerVisuals 5 | @onready var _player_sprite: Sprite2D = %PlayerSprite 6 | @onready var _interaction_prompt: Panel = %InteractionPrompt 7 | @onready var _ui_sign: Control 8 | @onready var _dark_overlay: ColorRect = %DarkOverlay 9 | @onready var _noise_emitter: PhantomCameraNoiseEmitter2D 10 | 11 | const KEY_STRINGNAME: StringName = "Key" 12 | const ACTION_STRINGNAME: StringName = "Action" 13 | const INPUT_MOVE_LEFT_STRINGNAME: StringName = "move_left" 14 | const INPUT_MOVE_RIGHT_STRINGNAME: StringName = "move_right" 15 | 16 | const SPEED = 350.0 17 | const JUMP_VELOCITY = -750.0 18 | 19 | # Get the gravity from the project settings to be synced with RigidBody nodes. 20 | var gravity: int = 2400 21 | var _is_interactive: bool 22 | var _can_open_inventory: bool 23 | var _movement_disabled: bool 24 | var tween: Tween 25 | var _interactive_UI: Control 26 | var _active_pcam: PhantomCamera2D 27 | 28 | enum InteractiveType { 29 | NONE = 0, 30 | ITEM = 1, 31 | INVENTORY = 2, 32 | } 33 | var _interactive_object: InteractiveType = InteractiveType.NONE 34 | 35 | var InputMovementDic: Dictionary = { 36 | INPUT_MOVE_LEFT_STRINGNAME: { 37 | KEY_STRINGNAME: KEY_A, 38 | ACTION_STRINGNAME: INPUT_MOVE_LEFT_STRINGNAME 39 | }, 40 | INPUT_MOVE_RIGHT_STRINGNAME: { 41 | KEY_STRINGNAME: KEY_D, 42 | ACTION_STRINGNAME: INPUT_MOVE_RIGHT_STRINGNAME 43 | }, 44 | } 45 | 46 | 47 | func _ready() -> void: 48 | _player_area2d.body_shape_entered.connect(_show_prompt) 49 | _player_area2d.body_shape_exited.connect(_hide_prompt) 50 | 51 | _ui_sign = owner.get_node("%UISign") 52 | 53 | for input in InputMovementDic: 54 | var key_val = InputMovementDic[input].get(KEY_STRINGNAME) 55 | var action_val = InputMovementDic[input].get(ACTION_STRINGNAME) 56 | 57 | var movement_input = InputEventKey.new() 58 | movement_input.physical_keycode = key_val 59 | InputMap.add_action(action_val) 60 | InputMap.action_add_event(action_val, movement_input) 61 | 62 | if Engine.get_version_info().major == 4 and \ 63 | Engine.get_version_info().minor < 3: 64 | printerr("This scene is designed to only work properly in Godot 4.3 or later that supports 2D Physics Interpolation.") 65 | printerr("Please run the other 2D example scenes in the other directory.") 66 | 67 | 68 | func _unhandled_input(event: InputEvent) -> void: 69 | if _is_interactive: 70 | if Input.is_physical_key_pressed(KEY_F): 71 | if tween: 72 | tween.kill() 73 | 74 | if not _movement_disabled: 75 | tween = get_tree().create_tween() 76 | 77 | _movement_disabled = true 78 | _active_pcam.set_priority(10) 79 | 80 | _show_interactive_node(_interactive_UI) 81 | _interactive_node_logic() 82 | 83 | else: 84 | _hide_interactive_node(_interactive_UI) 85 | _interactive_node_logic() 86 | 87 | 88 | if Input.is_physical_key_pressed(KEY_ESCAPE) and _movement_disabled: 89 | _hide_interactive_node(_interactive_UI) 90 | _interactive_node_logic() 91 | 92 | if Input.is_physical_key_pressed(KEY_Q): 93 | if get_node_or_null("%PlayerPhantomCameraNoiseEmitter2D"): 94 | %PlayerPhantomCameraNoiseEmitter2D.emit() 95 | 96 | 97 | func _show_interactive_node(UI: Control) -> void: 98 | UI.modulate.a = 0 99 | UI.visible = true 100 | tween.tween_property(UI, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CIRC) 101 | 102 | 103 | func _hide_interactive_node(UI: Control) -> void: 104 | _movement_disabled = false 105 | _active_pcam.set_priority(0) 106 | UI.visible = false 107 | 108 | 109 | func _interactive_node_logic() -> void: 110 | match _interactive_object: 111 | 2: 112 | if _movement_disabled: 113 | _dark_overlay.set_visible(true) 114 | else: 115 | _dark_overlay.set_visible(false) 116 | 117 | 118 | func _physics_process(delta: float) -> void: 119 | if not is_on_floor(): 120 | velocity.y += gravity * delta 121 | 122 | if Input.is_action_just_pressed("ui_accept") and is_on_floor(): 123 | velocity.y = JUMP_VELOCITY 124 | 125 | if _movement_disabled: return 126 | 127 | var input_dir: = Input.get_axis( 128 | INPUT_MOVE_LEFT_STRINGNAME, 129 | INPUT_MOVE_RIGHT_STRINGNAME 130 | ) 131 | 132 | if input_dir: 133 | velocity.x = input_dir * SPEED 134 | if input_dir > 0: 135 | _player_sprite.set_flip_h(false) 136 | elif input_dir < 0: 137 | _player_sprite.set_flip_h(true) 138 | else: 139 | velocity.x = move_toward(velocity.x, 0, SPEED) 140 | 141 | move_and_slide() 142 | 143 | 144 | func _show_prompt(body_rid: RID, body: Node2D, body_shape_index: int, local_shape: int) -> void: 145 | if body.is_class("TileMapLayer"): # TODO - Using string reference to support Godot 4.2 146 | var tile_map := body 147 | var tile_coords: Vector2i = tile_map.get_coords_for_body_rid(body_rid) 148 | var cell_data: TileData = tile_map.get_cell_tile_data(tile_coords) 149 | 150 | if cell_data: 151 | var cell_data_type: StringName = cell_data.get_custom_data("Type") 152 | # var cell_global_pos: Vector2 = tile_map.to_global(tile_map.map_to_local(tile_coords)) 153 | _is_interactive = true 154 | _interaction_prompt.set_visible(true) 155 | 156 | match cell_data_type: 157 | "Sign": 158 | _interactive_UI = owner.get_node("%UISign") 159 | _active_pcam = %ItemFocusPhantomCamera2D 160 | _interactive_object = InteractiveType.ITEM 161 | "Inventory": 162 | _interactive_UI = owner.get_node("%UIInventory") 163 | _interactive_object = InteractiveType.INVENTORY 164 | _active_pcam = %InventoryPhantomCamera2D 165 | 166 | 167 | func _hide_prompt(body_rid: RID, body: Node2D, body_shape_index: int, local_shape: int) -> void: 168 | if body.is_class("TileMapLayer"): # TODO - Using string reference to support Godot 4.2 169 | var tile_map := body 170 | 171 | var tile_coords: Vector2i = tile_map.get_coords_for_body_rid(body_rid) 172 | var cell_data: TileData = tile_map.get_cell_tile_data(tile_coords) 173 | 174 | if cell_data: 175 | _interaction_prompt.set_visible(false) 176 | _is_interactive = false 177 | _interactive_UI = null 178 | _interactive_object = InteractiveType.NONE 179 | _active_pcam = null 180 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/2D/player_character_body_2d_4.3.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cnnaky2ns2pn4 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/3d_trigger_area.gd: -------------------------------------------------------------------------------- 1 | extends Area3D 2 | 3 | @export var area_pcam: PhantomCamera3D 4 | 5 | var initial_camera_position: Vector3 6 | var initial_camera_rotation: Vector3 7 | 8 | var tween: Tween 9 | var tween_duration: float = 0.9 10 | 11 | 12 | func _ready() -> void: 13 | connect("area_entered", _entered_area) 14 | connect("area_exited", _exited_area) 15 | 16 | 17 | func _entered_area(area_3D: Area3D) -> void: 18 | if area_3D.get_parent() is CharacterBody3D: 19 | area_pcam.set_priority(20) 20 | 21 | 22 | func _exited_area(area_3D: Area3D) -> void: 23 | if area_3D.get_parent() is CharacterBody3D: 24 | area_pcam.set_priority(0) 25 | 26 | 27 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/3d_trigger_area.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bnhxcejvr6wi3 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/npc.gd: -------------------------------------------------------------------------------- 1 | extends Node3D 2 | 3 | @onready var npc_pcam: PhantomCamera3D = %NPCPhantomCamera3D 4 | @onready var dialogueArea: Area3D = %NPCInteractionArea3D 5 | @onready var dialogueLabel3D: Label3D = %NPCDialogueExampleLabel 6 | 7 | @onready var player: CharacterBody3D = %PlayerCharacterBody3D 8 | 9 | @onready var move_to_location: Vector3 = %MoveToLocation.get_global_position() 10 | 11 | var dialogue_label_initial_position: Vector3 12 | var dialogue_label_initial_rotation: Vector3 13 | 14 | var tween: Tween 15 | var tween_duration: float = 0.9 16 | var tween_transition: Tween.TransitionType = Tween.TRANS_QUAD 17 | 18 | var interactable: bool 19 | var is_interacting: bool 20 | 21 | func _ready() -> void: 22 | dialogueArea.connect("area_entered", _interactable) 23 | dialogueArea.connect("area_exited", _not_interactable) 24 | 25 | dialogueLabel3D.set_visible(false) 26 | 27 | dialogue_label_initial_position = dialogueLabel3D.get_global_position() 28 | dialogue_label_initial_rotation = dialogueLabel3D.get_global_rotation() 29 | 30 | npc_pcam.tween_completed.connect(_on_tween_started) 31 | 32 | 33 | 34 | func _on_tween_started() -> void: 35 | player.movement_enabled = false 36 | 37 | 38 | func _interactable(area_3D: Area3D) -> void: 39 | if area_3D.get_parent() is CharacterBody3D: 40 | dialogueLabel3D.set_visible(true) 41 | interactable = true 42 | 43 | var tween: Tween = get_tree().create_tween().set_trans(tween_transition).set_ease(Tween.EASE_IN_OUT).set_loops() 44 | tween.tween_property(dialogueLabel3D, "global_position", dialogue_label_initial_position - Vector3(0, -0.2, 0), tween_duration) 45 | tween.tween_property(dialogueLabel3D, "position", dialogue_label_initial_position, tween_duration) 46 | 47 | 48 | func _not_interactable(area_3D: Area3D) -> void: 49 | if area_3D.get_parent() is CharacterBody3D: 50 | dialogueLabel3D.set_visible(false) 51 | interactable = false 52 | 53 | 54 | func _input(event) -> void: 55 | if not interactable: return 56 | 57 | if event is InputEventKey and event.pressed: 58 | if event.keycode == KEY_F: 59 | var tween: Tween = get_tree().create_tween() \ 60 | .set_parallel(true) \ 61 | .set_trans(Tween.TRANS_QUART) \ 62 | .set_ease(Tween.EASE_IN_OUT) 63 | if not is_interacting: 64 | npc_pcam.priority = 20 65 | tween.tween_property(player, "global_position", move_to_location, 0.6).set_trans(tween_transition) 66 | tween.tween_property(dialogueLabel3D, "rotation", Vector3(deg_to_rad(-20), deg_to_rad(53), 0), 0.6).set_trans(tween_transition) 67 | else: 68 | npc_pcam.priority = 0 69 | tween.tween_property(dialogueLabel3D, "rotation", dialogue_label_initial_rotation, 0.9) 70 | player.movement_enabled = true 71 | is_interacting = !is_interacting 72 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/npc.gd.uid: -------------------------------------------------------------------------------- 1 | uid://uvw6pg1ut0ms 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/path_follow.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | @export var path_pcam: PhantomCamera3D 4 | 5 | func _ready() -> void: 6 | connect("area_entered", _entered_area) 7 | connect("area_exited", _exited_area) 8 | 9 | 10 | func _entered_area(area_3D: Area3D) -> void: 11 | if area_3D.get_parent() is CharacterBody3D: 12 | path_pcam.set_priority(20) 13 | 14 | 15 | func _exited_area(area_3D: Area3D) -> void: 16 | if area_3D.get_parent() is CharacterBody3D: 17 | path_pcam.set_priority(0) 18 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/path_follow.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cgknbkjar73w 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller.gd: -------------------------------------------------------------------------------- 1 | extends CharacterBody3D 2 | 3 | @export var SPEED: float = 5.0 4 | @export var JUMP_VELOCITY: float = 4.5 5 | @export var enable_gravity = true 6 | 7 | @onready var _camera: Camera3D 8 | 9 | @onready var _player_visual: Node3D = %PlayerVisual 10 | 11 | # Get the gravity from the project settings to be synced with RigidBody nodes. 12 | var gravity: float = 9.8 13 | 14 | var movement_enabled: bool = true 15 | 16 | var _physics_body_trans_last: Transform3D 17 | var _physics_body_trans_current: Transform3D 18 | 19 | const KEY_STRINGNAME: StringName = "Key" 20 | const ACTION_STRINGNAME: StringName = "Action" 21 | 22 | const INPUT_MOVE_UP_STRINGNAME: StringName = "move_up" 23 | const INPUT_MOVE_DOWM_STRINGNAME: StringName = "move_down" 24 | const INPUT_MOVE_LEFT_STRINGNAME: StringName = "move_left" 25 | const INPUT_MOVE_RIGHT_STRINGNAME: StringName = "move_right" 26 | 27 | var InputMovementDic: Dictionary = { 28 | INPUT_MOVE_UP_STRINGNAME: { 29 | KEY_STRINGNAME: KEY_W, 30 | ACTION_STRINGNAME: INPUT_MOVE_UP_STRINGNAME 31 | }, 32 | INPUT_MOVE_DOWM_STRINGNAME: { 33 | KEY_STRINGNAME: KEY_S, 34 | ACTION_STRINGNAME: INPUT_MOVE_DOWM_STRINGNAME 35 | }, 36 | INPUT_MOVE_LEFT_STRINGNAME: { 37 | KEY_STRINGNAME: KEY_A, 38 | ACTION_STRINGNAME: INPUT_MOVE_LEFT_STRINGNAME 39 | }, 40 | INPUT_MOVE_RIGHT_STRINGNAME: { 41 | KEY_STRINGNAME: KEY_D, 42 | ACTION_STRINGNAME: INPUT_MOVE_RIGHT_STRINGNAME 43 | }, 44 | } 45 | 46 | 47 | func _ready() -> void: 48 | for input in InputMovementDic: 49 | var key_val = InputMovementDic[input].get(KEY_STRINGNAME) 50 | var action_val = InputMovementDic[input].get(ACTION_STRINGNAME) 51 | 52 | _camera = owner.get_node("%MainCamera3D") 53 | 54 | var movement_input = InputEventKey.new() 55 | movement_input.physical_keycode = key_val 56 | InputMap.add_action(action_val) 57 | InputMap.action_add_event(action_val, movement_input) 58 | 59 | _player_visual.top_level = true 60 | 61 | 62 | func _physics_process(delta: float) -> void: 63 | _physics_body_trans_last = _physics_body_trans_current 64 | _physics_body_trans_current = global_transform 65 | 66 | # Add the gravity. 67 | if enable_gravity and not is_on_floor(): 68 | velocity.y -= gravity * delta 69 | 70 | if not movement_enabled: return 71 | 72 | # Get the input direction and handle the movement/deceleration. 73 | # As good practice, you should replace UI actions with custom gameplay actions. 74 | var input_dir: Vector2 = Input.get_vector( 75 | INPUT_MOVE_LEFT_STRINGNAME, 76 | INPUT_MOVE_RIGHT_STRINGNAME, 77 | INPUT_MOVE_UP_STRINGNAME, 78 | INPUT_MOVE_DOWM_STRINGNAME 79 | ) 80 | 81 | var cam_dir: Vector3 = -_camera.global_transform.basis.z 82 | 83 | var direction: Vector3 = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() 84 | if direction: 85 | var move_dir: Vector3 = Vector3.ZERO 86 | move_dir.x = direction.x 87 | move_dir.z = direction.z 88 | 89 | move_dir = move_dir.rotated(Vector3.UP, _camera.rotation.y).normalized() 90 | velocity.x = move_dir.x * SPEED 91 | velocity.z = move_dir.z * SPEED 92 | else: 93 | velocity.x = move_toward(velocity.x, 0, SPEED) 94 | velocity.z = move_toward(velocity.z, 0, SPEED) 95 | 96 | move_and_slide() 97 | 98 | 99 | func _process(_delta: float) -> void: 100 | _player_visual.global_transform = _physics_body_trans_last.interpolate_with( 101 | _physics_body_trans_current, 102 | Engine.get_physics_interpolation_fraction() 103 | ) 104 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dut3e76k2c71n 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_4.4.gd: -------------------------------------------------------------------------------- 1 | extends CharacterBody3D 2 | 3 | @export var SPEED: float = 5.0 4 | @export var JUMP_VELOCITY: float = 4.5 5 | @export var enable_gravity = true 6 | 7 | @onready var _camera: Camera3D 8 | 9 | # Get the gravity from the project settings to be synced with RigidBody nodes. 10 | var gravity: float = 9.8 11 | 12 | var movement_enabled: bool = true 13 | 14 | const KEY_STRINGNAME: StringName = "Key" 15 | const ACTION_STRINGNAME: StringName = "Action" 16 | 17 | const INPUT_MOVE_UP_STRINGNAME: StringName = "move_up" 18 | const INPUT_MOVE_DOWM_STRINGNAME: StringName = "move_down" 19 | const INPUT_MOVE_LEFT_STRINGNAME: StringName = "move_left" 20 | const INPUT_MOVE_RIGHT_STRINGNAME: StringName = "move_right" 21 | 22 | var InputMovementDic: Dictionary = { 23 | INPUT_MOVE_UP_STRINGNAME: { 24 | KEY_STRINGNAME: KEY_W, 25 | ACTION_STRINGNAME: INPUT_MOVE_UP_STRINGNAME 26 | }, 27 | INPUT_MOVE_DOWM_STRINGNAME: { 28 | KEY_STRINGNAME: KEY_S, 29 | ACTION_STRINGNAME: INPUT_MOVE_DOWM_STRINGNAME 30 | }, 31 | INPUT_MOVE_LEFT_STRINGNAME: { 32 | KEY_STRINGNAME: KEY_A, 33 | ACTION_STRINGNAME: INPUT_MOVE_LEFT_STRINGNAME 34 | }, 35 | INPUT_MOVE_RIGHT_STRINGNAME: { 36 | KEY_STRINGNAME: KEY_D, 37 | ACTION_STRINGNAME: INPUT_MOVE_RIGHT_STRINGNAME 38 | }, 39 | } 40 | 41 | 42 | func _ready() -> void: 43 | for input in InputMovementDic: 44 | var key_val = InputMovementDic[input].get(KEY_STRINGNAME) 45 | var action_val = InputMovementDic[input].get(ACTION_STRINGNAME) 46 | 47 | _camera = owner.get_node("%MainCamera3D") 48 | 49 | var movement_input = InputEventKey.new() 50 | movement_input.physical_keycode = key_val 51 | InputMap.add_action(action_val) 52 | InputMap.action_add_event(action_val, movement_input) 53 | 54 | 55 | func _physics_process(delta: float) -> void: 56 | # Add the gravity. 57 | if enable_gravity and not is_on_floor(): 58 | velocity.y -= gravity * delta 59 | 60 | if not movement_enabled: return 61 | 62 | # Get the input direction and handle the movement/deceleration. 63 | # As good practice, you should replace UI actions with custom gameplay actions. 64 | var input_dir: Vector2 = Input.get_vector( 65 | INPUT_MOVE_LEFT_STRINGNAME, 66 | INPUT_MOVE_RIGHT_STRINGNAME, 67 | INPUT_MOVE_UP_STRINGNAME, 68 | INPUT_MOVE_DOWM_STRINGNAME 69 | ) 70 | 71 | var direction: Vector3 = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized() 72 | if direction: 73 | var move_dir: Vector3 = Vector3.ZERO 74 | move_dir.x = direction.x 75 | move_dir.z = direction.z 76 | 77 | move_dir = move_dir.rotated(Vector3.UP, _camera.rotation.y).normalized() 78 | velocity.x = move_dir.x * SPEED 79 | velocity.z = move_dir.z * SPEED 80 | else: 81 | velocity.x = move_toward(velocity.x, 0, SPEED) 82 | velocity.z = move_toward(velocity.z, 0, SPEED) 83 | 84 | move_and_slide() 85 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_4.4.gd.uid: -------------------------------------------------------------------------------- 1 | uid://tgv6xpi88sd0 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_first_person.gd: -------------------------------------------------------------------------------- 1 | extends "player_controller.gd" 2 | 3 | @onready var _player_pcam: PhantomCamera3D = %PlayerPhantomCamera3D 4 | 5 | @onready var _player_character: CharacterBody3D = %PlayerCharacterBody3D 6 | 7 | @export var mouse_sensitivity: float = 0.05 8 | 9 | @export var min_pitch: float = -89.9 10 | @export var max_pitch: float = 50 11 | 12 | @export var min_yaw: float = 0 13 | @export var max_yaw: float = 360 14 | 15 | @export var run_noise: PhantomCameraNoise3D 16 | 17 | func _ready() -> void: 18 | super() 19 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 20 | 21 | if get_node_or_null("%PlayerPhantomCameraNoiseEmitter3D"): 22 | %EmitterTip.visible = true 23 | 24 | 25 | func _physics_process(delta: float) -> void: 26 | super(delta) 27 | 28 | 29 | func _unhandled_input(event: InputEvent) -> void: 30 | if event is InputEventKey: 31 | if get_node_or_null("%PlayerPhantomCameraNoiseEmitter3D"): 32 | if event.keycode == KEY_Q and event.is_pressed(): 33 | %PlayerPhantomCameraNoiseEmitter3D.emit() 34 | 35 | if event is InputEventMouseMotion: 36 | var pcam_rotation_degrees: Vector3 37 | 38 | # Assigns the current 3D rotation of the SpringArm3D node - so it starts off where it is in the editor 39 | pcam_rotation_degrees = _player_pcam.rotation_degrees 40 | 41 | # Change the X rotation 42 | pcam_rotation_degrees.x -= event.relative.y * mouse_sensitivity 43 | 44 | # Clamp the rotation in the X axis so it go over or under the target 45 | pcam_rotation_degrees.x = clampf(pcam_rotation_degrees.x, min_pitch, max_pitch) 46 | 47 | # Change the Y rotation value 48 | pcam_rotation_degrees.y -= event.relative.x * mouse_sensitivity 49 | 50 | # Sets the rotation to fully loop around its target, but witout going below or exceeding 0 and 360 degrees respectively 51 | pcam_rotation_degrees.y = wrapf(pcam_rotation_degrees.y, min_yaw, max_yaw) 52 | 53 | # Change the SpringArm3D node's rotation and rotate around its target 54 | _player_pcam.rotation_degrees = pcam_rotation_degrees 55 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_first_person.gd.uid: -------------------------------------------------------------------------------- 1 | uid://b3n22atuw76sm 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_first_person_4.4.gd: -------------------------------------------------------------------------------- 1 | extends "player_controller_4.4.gd" 2 | 3 | @onready var _player_pcam: PhantomCamera3D = %PlayerPhantomCamera3D 4 | 5 | @onready var _player_character: CharacterBody3D = %PlayerCharacterBody3D 6 | 7 | @export var mouse_sensitivity: float = 0.05 8 | 9 | @export var min_pitch: float = -89.9 10 | @export var max_pitch: float = 50 11 | 12 | @export var min_yaw: float = 0 13 | @export var max_yaw: float = 360 14 | 15 | @export var run_noise: PhantomCameraNoise3D 16 | 17 | func _ready() -> void: 18 | super() 19 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 20 | 21 | if get_node_or_null("%PlayerPhantomCameraNoiseEmitter3D"): 22 | %EmitterTip.visible = true 23 | 24 | 25 | func _physics_process(delta: float) -> void: 26 | super(delta) 27 | 28 | 29 | func _unhandled_input(event: InputEvent) -> void: 30 | if event is InputEventKey: 31 | if get_node_or_null("%PlayerPhantomCameraNoiseEmitter3D"): 32 | if event.keycode == KEY_Q and event.is_pressed(): 33 | %PlayerPhantomCameraNoiseEmitter3D.emit() 34 | 35 | if event is InputEventMouseMotion: 36 | var pcam_rotation_degrees: Vector3 37 | 38 | # Assigns the current 3D rotation of the SpringArm3D node - so it starts off where it is in the editor 39 | pcam_rotation_degrees = _player_pcam.rotation_degrees 40 | 41 | # Change the X rotation 42 | pcam_rotation_degrees.x -= event.relative.y * mouse_sensitivity 43 | 44 | # Clamp the rotation in the X axis so it go over or under the target 45 | pcam_rotation_degrees.x = clampf(pcam_rotation_degrees.x, min_pitch, max_pitch) 46 | 47 | # Change the Y rotation value 48 | pcam_rotation_degrees.y -= event.relative.x * mouse_sensitivity 49 | 50 | # Sets the rotation to fully loop around its target, but witout going below or exceeding 0 and 360 degrees respectively 51 | pcam_rotation_degrees.y = wrapf(pcam_rotation_degrees.y, min_yaw, max_yaw) 52 | 53 | # Change the SpringArm3D node's rotation and rotate around its target 54 | _player_pcam.rotation_degrees = pcam_rotation_degrees 55 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_first_person_4.4.gd.uid: -------------------------------------------------------------------------------- 1 | uid://x5g7kf5k2mac 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_third_person.gd: -------------------------------------------------------------------------------- 1 | extends "player_controller.gd" 2 | 3 | @onready var _player_pcam: PhantomCamera3D 4 | @onready var _aim_pcam: PhantomCamera3D 5 | @onready var _player_direction: Node3D = %PlayerDirection 6 | @onready var _ceiling_pcam: PhantomCamera3D 7 | 8 | @export var mouse_sensitivity: float = 0.05 9 | 10 | @export var min_pitch: float = -89.9 11 | @export var max_pitch: float = 50 12 | 13 | @export var min_yaw: float = 0 14 | @export var max_yaw: float = 360 15 | 16 | 17 | 18 | func _ready() -> void: 19 | super() 20 | 21 | _player_pcam = owner.get_node("%PlayerPhantomCamera3D") 22 | _aim_pcam = owner.get_node("%PlayerAimPhantomCamera3D") 23 | _ceiling_pcam = owner.get_node("%CeilingPhantomCamera3D") 24 | 25 | if _player_pcam.get_follow_mode() == _player_pcam.FollowMode.THIRD_PERSON: 26 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 27 | 28 | 29 | func _physics_process(delta: float) -> void: 30 | super(delta) 31 | 32 | if velocity.length() > 0.2: 33 | var look_direction: Vector2 = Vector2(velocity.z, velocity.x) 34 | _player_direction.rotation.y = look_direction.angle() 35 | 36 | 37 | func _unhandled_input(event: InputEvent) -> void: 38 | if _player_pcam.get_follow_mode() == _player_pcam.FollowMode.THIRD_PERSON: 39 | var active_pcam: PhantomCamera3D 40 | 41 | _set_pcam_rotation(_player_pcam, event) 42 | _set_pcam_rotation(_aim_pcam, event) 43 | if _player_pcam.get_priority() > _aim_pcam.get_priority(): 44 | _toggle_aim_pcam(event) 45 | else: 46 | _toggle_aim_pcam(event) 47 | 48 | if event is InputEventKey and event.pressed: 49 | if event.keycode == KEY_SPACE: 50 | if _ceiling_pcam.get_priority() < 30 and _player_pcam.is_active(): 51 | _ceiling_pcam.set_priority(30) 52 | else: 53 | _ceiling_pcam.set_priority(1) 54 | 55 | 56 | func _set_pcam_rotation(pcam: PhantomCamera3D, event: InputEvent) -> void: 57 | if event is InputEventMouseMotion: 58 | var pcam_rotation_degrees: Vector3 59 | 60 | # Assigns the current 3D rotation of the SpringArm3D node - so it starts off where it is in the editor 61 | pcam_rotation_degrees = pcam.get_third_person_rotation_degrees() 62 | 63 | # Change the X rotation 64 | pcam_rotation_degrees.x -= event.relative.y * mouse_sensitivity 65 | 66 | # Clamp the rotation in the X axis so it go over or under the target 67 | pcam_rotation_degrees.x = clampf(pcam_rotation_degrees.x, min_pitch, max_pitch) 68 | 69 | # Change the Y rotation value 70 | pcam_rotation_degrees.y -= event.relative.x * mouse_sensitivity 71 | 72 | # Sets the rotation to fully loop around its target, but witout going below or exceeding 0 and 360 degrees respectively 73 | pcam_rotation_degrees.y = wrapf(pcam_rotation_degrees.y, min_yaw, max_yaw) 74 | 75 | # Change the SpringArm3D node's rotation and rotate around its target 76 | pcam.set_third_person_rotation_degrees(pcam_rotation_degrees) 77 | 78 | 79 | func _toggle_aim_pcam(event: InputEvent) -> void: 80 | if event is InputEventMouseButton \ 81 | and event.is_pressed() \ 82 | and event.button_index == 2 \ 83 | and (_player_pcam.is_active() or _aim_pcam.is_active()): 84 | if _player_pcam.get_priority() > _aim_pcam.get_priority(): 85 | _aim_pcam.set_priority(30) 86 | else: 87 | _aim_pcam.set_priority(0) 88 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_third_person.gd.uid: -------------------------------------------------------------------------------- 1 | uid://34uhyq3cpi67 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_third_person_4.4.gd: -------------------------------------------------------------------------------- 1 | extends "player_controller_4.4.gd" 2 | 3 | @onready var _player_pcam: PhantomCamera3D 4 | @onready var _aim_pcam: PhantomCamera3D 5 | @onready var _player_direction: Node3D = %PlayerDirection 6 | @onready var _ceiling_pcam: PhantomCamera3D 7 | 8 | @export var mouse_sensitivity: float = 0.05 9 | 10 | @export var min_pitch: float = -89.9 11 | @export var max_pitch: float = 50 12 | 13 | @export var min_yaw: float = 0 14 | @export var max_yaw: float = 360 15 | 16 | 17 | func _ready() -> void: 18 | super() 19 | 20 | _player_pcam = owner.get_node("%PlayerPhantomCamera3D") 21 | _aim_pcam = owner.get_node("%PlayerAimPhantomCamera3D") 22 | _ceiling_pcam = owner.get_node("%CeilingPhantomCamera3D") 23 | 24 | if _player_pcam.get_follow_mode() == _player_pcam.FollowMode.THIRD_PERSON: 25 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) 26 | 27 | 28 | func _physics_process(delta: float) -> void: 29 | super(delta) 30 | 31 | if velocity.length() > 0.2: 32 | var look_direction: Vector2 = Vector2(velocity.z, velocity.x) 33 | _player_direction.rotation.y = look_direction.angle() 34 | 35 | 36 | func _unhandled_input(event: InputEvent) -> void: 37 | if _player_pcam.get_follow_mode() == _player_pcam.FollowMode.THIRD_PERSON: 38 | var active_pcam: PhantomCamera3D 39 | 40 | _set_pcam_rotation(_player_pcam, event) 41 | _set_pcam_rotation(_aim_pcam, event) 42 | if _player_pcam.get_priority() > _aim_pcam.get_priority(): 43 | _toggle_aim_pcam(event) 44 | else: 45 | _toggle_aim_pcam(event) 46 | 47 | if event is InputEventKey and event.pressed: 48 | if event.keycode == KEY_SPACE: 49 | if _ceiling_pcam.get_priority() < 30 and _player_pcam.is_active(): 50 | _ceiling_pcam.set_priority(30) 51 | else: 52 | _ceiling_pcam.set_priority(1) 53 | 54 | 55 | func _set_pcam_rotation(pcam: PhantomCamera3D, event: InputEvent) -> void: 56 | if event is InputEventMouseMotion: 57 | var pcam_rotation_degrees: Vector3 58 | 59 | # Assigns the current 3D rotation of the SpringArm3D node - so it starts off where it is in the editor 60 | pcam_rotation_degrees = pcam.get_third_person_rotation_degrees() 61 | 62 | # Change the X rotation 63 | pcam_rotation_degrees.x -= event.relative.y * mouse_sensitivity 64 | 65 | # Clamp the rotation in the X axis so it go over or under the target 66 | pcam_rotation_degrees.x = clampf(pcam_rotation_degrees.x, min_pitch, max_pitch) 67 | 68 | # Change the Y rotation value 69 | pcam_rotation_degrees.y -= event.relative.x * mouse_sensitivity 70 | 71 | # Sets the rotation to fully loop around its target, but witout going below or exceeding 0 and 360 degrees respectively 72 | pcam_rotation_degrees.y = wrapf(pcam_rotation_degrees.y, min_yaw, max_yaw) 73 | 74 | # Change the SpringArm3D node's rotation and rotate around its target 75 | pcam.set_third_person_rotation_degrees(pcam_rotation_degrees) 76 | 77 | 78 | func _toggle_aim_pcam(event: InputEvent) -> void: 79 | if event is InputEventMouseButton \ 80 | and event.is_pressed() \ 81 | and event.button_index == 2 \ 82 | and (_player_pcam.is_active() or _aim_pcam.is_active()): 83 | if _player_pcam.get_priority() > _aim_pcam.get_priority(): 84 | _aim_pcam.set_priority(30) 85 | else: 86 | _aim_pcam.set_priority(0) 87 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/scripts/3D/player_controller_third_person_4.4.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bkr71vxe2t18n 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/inventory_container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/examples/textures/2D/inventory_container.png -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/inventory_container.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://b7cs6me43ufh3" 6 | path="res://.godot/imported/inventory_container.png-12241277f279bfc4bf7d5dad6b3e8ff2.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/examples/textures/2D/inventory_container.png" 14 | dest_files=["res://.godot/imported/inventory_container.png-12241277f279bfc4bf7d5dad6b3e8ff2.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/level_spritesheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/examples/textures/2D/level_spritesheet.png -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/level_spritesheet.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c77npili4pel4" 6 | path="res://.godot/imported/level_spritesheet.png-26a44dd21a040a5480d5ccba54377d99.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/examples/textures/2D/level_spritesheet.png" 14 | dest_files=["res://.godot/imported/level_spritesheet.png-26a44dd21a040a5480d5ccba54377d99.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/phantom_camera_2d_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/examples/textures/2D/phantom_camera_2d_sprite.png -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/phantom_camera_2d_sprite.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cwep0on2tthn7" 6 | path="res://.godot/imported/phantom_camera_2d_sprite.png-deab230b83ae03aeb308a08ff66b8dbc.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/examples/textures/2D/phantom_camera_2d_sprite.png" 14 | dest_files=["res://.godot/imported/phantom_camera_2d_sprite.png-deab230b83ae03aeb308a08ff66b8dbc.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/player_sprite.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/player_sprite.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cscjjt55iw2cu" 6 | path="res://.godot/imported/player_sprite.svg-8862ecb19e12152eb892607676f3831f.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/examples/textures/2D/player_sprite.svg" 14 | dest_files=["res://.godot/imported/player_sprite.svg-8862ecb19e12152eb892607676f3831f.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=8.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/sign_prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/examples/textures/2D/sign_prompt.png -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/2D/sign_prompt.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bloouh2jtndx1" 6 | path="res://.godot/imported/sign_prompt.png-18d451127e1cd1a16367acd23cec47e5.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/examples/textures/2D/sign_prompt.png" 14 | dest_files=["res://.godot/imported/sign_prompt.png-18d451127e1cd1a16367acd23cec47e5.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/3D/checker_pattern_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/examples/textures/3D/checker_pattern_dark.png -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/3D/checker_pattern_dark.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://bj7h2fc5jx4ax" 6 | path.s3tc="res://.godot/imported/checker_pattern_dark.png-70cedad2d3abf4ad6166d6614eefa7fb.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/examples/textures/3D/checker_pattern_dark.png" 15 | dest_files=["res://.godot/imported/checker_pattern_dark.png-70cedad2d3abf4ad6166d6614eefa7fb.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/3D/target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/examples/textures/3D/target.png -------------------------------------------------------------------------------- /addons/phantom_camera/examples/textures/3D/target.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c3mskbmvnpwux" 6 | path.s3tc="res://.godot/imported/target.png-878c5e8d057c8a9a4c2322d4ab88e9ef.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/examples/textures/3D/target.png" 15 | dest_files=["res://.godot/imported/target.png-878c5e8d057c8a9a4c2322d4ab88e9ef.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/ui/ui_inventory.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=3 uid="uid://dg7rhrymsrrrm"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://b7cs6me43ufh3" path="res://addons/phantom_camera/examples/textures/2D/inventory_container.png" id="1_pi2dp"] 4 | [ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="2_0rdcn"] 5 | 6 | [node name="Control" type="Control"] 7 | layout_mode = 3 8 | anchors_preset = 15 9 | anchor_right = 1.0 10 | anchor_bottom = 1.0 11 | grow_horizontal = 2 12 | grow_vertical = 2 13 | 14 | [node name="TextureRect" type="TextureRect" parent="."] 15 | layout_mode = 1 16 | anchors_preset = 4 17 | anchor_top = 0.5 18 | anchor_bottom = 0.5 19 | offset_left = 28.0 20 | offset_top = -255.0 21 | offset_right = 908.0 22 | offset_bottom = 183.0 23 | grow_vertical = 2 24 | texture = ExtResource("1_pi2dp") 25 | 26 | [node name="Label" type="Label" parent="TextureRect"] 27 | layout_mode = 0 28 | offset_left = 345.0 29 | offset_top = 12.0 30 | offset_right = 535.0 31 | offset_bottom = 60.0 32 | theme_override_colors/font_color = Color(0.356863, 0.105882, 0.133333, 1) 33 | theme_override_fonts/font = ExtResource("2_0rdcn") 34 | theme_override_font_sizes/font_size = 32 35 | text = "Inventory" 36 | horizontal_alignment = 1 37 | uppercase = true 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/examples/ui/ui_sign.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://iq5xd1ob1res"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://bloouh2jtndx1" path="res://addons/phantom_camera/examples/textures/2D/sign_prompt.png" id="1_tftrk"] 4 | [ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="2_y5454"] 5 | 6 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r4h3u"] 7 | bg_color = Color(0.470588, 0.6, 0.45098, 1) 8 | corner_radius_top_right = 47 9 | corner_radius_bottom_left = 40 10 | 11 | [node name="Control" type="Control"] 12 | layout_mode = 3 13 | anchors_preset = 15 14 | anchor_right = 1.0 15 | anchor_bottom = 1.0 16 | grow_horizontal = 2 17 | grow_vertical = 2 18 | size_flags_horizontal = 3 19 | size_flags_vertical = 3 20 | 21 | [node name="TextureRect" type="TextureRect" parent="."] 22 | layout_mode = 1 23 | anchors_preset = 5 24 | anchor_left = 0.5 25 | anchor_right = 0.5 26 | offset_left = -273.568 27 | offset_top = 47.0 28 | offset_right = 273.568 29 | offset_bottom = 413.0 30 | grow_horizontal = 2 31 | texture = ExtResource("1_tftrk") 32 | metadata/_edit_group_ = true 33 | 34 | [node name="Label" type="Label" parent="TextureRect"] 35 | layout_mode = 1 36 | anchors_preset = 15 37 | anchor_right = 1.0 38 | anchor_bottom = 1.0 39 | offset_left = 25.0 40 | offset_top = 64.0 41 | offset_right = -25.0 42 | offset_bottom = -88.0 43 | grow_horizontal = 2 44 | grow_vertical = 2 45 | theme_override_colors/font_color = Color(0.207843, 0.0470588, 0.0666667, 1) 46 | theme_override_fonts/font = ExtResource("2_y5454") 47 | theme_override_font_sizes/font_size = 62 48 | text = "Stay Awhile 49 | and read" 50 | horizontal_alignment = 1 51 | vertical_alignment = 1 52 | uppercase = true 53 | 54 | [node name="Panel" type="Panel" parent="."] 55 | visible = false 56 | layout_mode = 1 57 | anchors_preset = 5 58 | anchor_left = 0.5 59 | anchor_right = 0.5 60 | offset_left = -240.0 61 | offset_right = 240.0 62 | offset_bottom = 200.0 63 | grow_horizontal = 2 64 | size_flags_horizontal = 3 65 | size_flags_vertical = 3 66 | theme_override_styles/panel = SubResource("StyleBoxFlat_r4h3u") 67 | metadata/_edit_use_anchors_ = true 68 | 69 | [node name="VBoxContainer" type="VBoxContainer" parent="Panel"] 70 | layout_mode = 1 71 | anchors_preset = 15 72 | anchor_right = 1.0 73 | anchor_bottom = 1.0 74 | grow_horizontal = 2 75 | grow_vertical = 2 76 | alignment = 1 77 | 78 | [node name="Label2" type="Label" parent="Panel/VBoxContainer"] 79 | layout_mode = 2 80 | text = "Example Textsdadassa 81 | " 82 | horizontal_alignment = 1 83 | vertical_alignment = 1 84 | -------------------------------------------------------------------------------- /addons/phantom_camera/fonts/Nunito-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/fonts/Nunito-Black.ttf -------------------------------------------------------------------------------- /addons/phantom_camera/fonts/Nunito-Black.ttf.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="font_data_dynamic" 4 | type="FontFile" 5 | uid="uid://c4mm3of2mc8o5" 6 | path="res://.godot/imported/Nunito-Black.ttf-2a374efbc207a97a99b8c70bdc4b7cbb.fontdata" 7 | 8 | [deps] 9 | 10 | source_file="res://addons/phantom_camera/fonts/Nunito-Black.ttf" 11 | dest_files=["res://.godot/imported/Nunito-Black.ttf-2a374efbc207a97a99b8c70bdc4b7cbb.fontdata"] 12 | 13 | [params] 14 | 15 | Rendering=null 16 | antialiasing=1 17 | generate_mipmaps=false 18 | disable_embedded_bitmaps=true 19 | multichannel_signed_distance_field=false 20 | msdf_pixel_range=8 21 | msdf_size=48 22 | allow_system_fallback=true 23 | force_autohinter=false 24 | hinting=1 25 | subpixel_positioning=1 26 | keep_rounding_remainders=true 27 | oversampling=0.0 28 | Fallbacks=null 29 | fallbacks=[] 30 | Compress=null 31 | compress=true 32 | preload=[] 33 | language_support={} 34 | script_support={} 35 | opentype_features={} 36 | -------------------------------------------------------------------------------- /addons/phantom_camera/fonts/Nunito-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/fonts/Nunito-Regular.ttf -------------------------------------------------------------------------------- /addons/phantom_camera/fonts/Nunito-Regular.ttf.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="font_data_dynamic" 4 | type="FontFile" 5 | uid="uid://dve7mgsjik4dg" 6 | path="res://.godot/imported/Nunito-Regular.ttf-b6054d499efa1a10921004862b1e217a.fontdata" 7 | 8 | [deps] 9 | 10 | source_file="res://addons/phantom_camera/fonts/Nunito-Regular.ttf" 11 | dest_files=["res://.godot/imported/Nunito-Regular.ttf-b6054d499efa1a10921004862b1e217a.fontdata"] 12 | 13 | [params] 14 | 15 | Rendering=null 16 | antialiasing=1 17 | generate_mipmaps=false 18 | disable_embedded_bitmaps=true 19 | multichannel_signed_distance_field=false 20 | msdf_pixel_range=8 21 | msdf_size=48 22 | allow_system_fallback=true 23 | force_autohinter=false 24 | hinting=1 25 | subpixel_positioning=1 26 | keep_rounding_remainders=true 27 | oversampling=0.0 28 | Fallbacks=null 29 | fallbacks=[] 30 | Compress=null 31 | compress=true 32 | preload=[] 33 | language_support={} 34 | script_support={} 35 | opentype_features={} 36 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/misc/PriorityOverride.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/misc/PriorityOverride.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dy8eifa6aw2en" 6 | path="res://.godot/imported/PriorityOverride.svg-e76e07f4bbd98169f119e17fe5f2f03f.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/misc/PriorityOverride.svg" 14 | dest_files=["res://.godot/imported/PriorityOverride.svg-e76e07f4bbd98169f119e17fe5f2f03f.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_2d.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_2d.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dchkkx4v3ikpw" 6 | path="res://.godot/imported/phantom_camera_2d.svg-e5483cbc858fc5f95f7210b1649dff0d.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_2d.svg" 14 | dest_files=["res://.godot/imported/phantom_camera_2d.svg-e5483cbc858fc5f95f7210b1649dff0d.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_3d.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_3d.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://c71drpb8o4prn" 6 | path="res://.godot/imported/phantom_camera_3d.svg-41ed612e834470377fb56eebffa083fe.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_3d.svg" 14 | dest_files=["res://.godot/imported/phantom_camera_3d.svg-41ed612e834470377fb56eebffa083fe.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_camera_3d_resource.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_camera_3d_resource.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dnaykbu6ue5lo" 6 | path="res://.godot/imported/phantom_camera_camera_3d_resource.svg-f8bf8d1a5b7442fd6933bfbed999d57d.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_camera_3d_resource.svg" 14 | dest_files=["res://.godot/imported/phantom_camera_camera_3d_resource.svg-f8bf8d1a5b7442fd6933bfbed999d57d.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_gizmo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_gizmo.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://e36npe2rbxyg" 6 | path.s3tc="res://.godot/imported/phantom_camera_gizmo.svg-ba1aacb9b1c5f4ef401d3bd3697a542b.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/icons/phantom_camera_gizmo.svg" 15 | dest_files=["res://.godot/imported/phantom_camera_gizmo.svg-ba1aacb9b1c5f4ef401d3bd3697a542b.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=false 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_glow_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/icons/phantom_camera_glow_logo.png -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_glow_logo.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cjli3p2b8mfyh" 6 | path="res://.godot/imported/phantom_camera_glow_logo.png-078f944973b55b32029ba02980211fe0.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_glow_logo.png" 14 | dest_files=["res://.godot/imported/phantom_camera_glow_logo.png-078f944973b55b32029ba02980211fe0.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_host.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_host.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://5fatldiu7dd5" 6 | path="res://.godot/imported/phantom_camera_host.svg-3150f8f2d82ca9ecab9a3a415da21c5b.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/icons/phantom_camera_host.svg" 15 | dest_files=["res://.godot/imported/phantom_camera_host.svg-3150f8f2d82ca9ecab9a3a415da21c5b.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=false 38 | editor/convert_colors_with_editor_theme=true 39 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramokz/phantom-camera/64bde2b909e89e8ceae5d021e8b00e276343df5b/addons/phantom_camera/icons/phantom_camera_logo.png -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_logo.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cc0wmici0eic8" 6 | path="res://.godot/imported/phantom_camera_logo.png-8b8d347b5e4800c86cd8095d030a3e5a.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_logo.png" 14 | dest_files=["res://.godot/imported/phantom_camera_logo.png-8b8d347b5e4800c86cd8095d030a3e5a.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_emitter_2d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_emitter_2d.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://b2r7mhd780y8d" 6 | path="res://.godot/imported/phantom_camera_noise_emitter_2d.svg-1b3d37fe36964dc86a6ea6681d0772bb.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_noise_emitter_2d.svg" 14 | dest_files=["res://.godot/imported/phantom_camera_noise_emitter_2d.svg-1b3d37fe36964dc86a6ea6681d0772bb.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_emitter_3d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_emitter_3d.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cby76y7m6xn4f" 6 | path.s3tc="res://.godot/imported/phantom_camera_noise_emitter_3d.svg-9b90fe54aa618f65d52ac94515d41ea4.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/icons/phantom_camera_noise_emitter_3d.svg" 15 | dest_files=["res://.godot/imported/phantom_camera_noise_emitter_3d.svg-9b90fe54aa618f65d52ac94515d41ea4.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=false 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_emitter_gizmo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_emitter_gizmo.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dw4iy855s0atm" 6 | path.s3tc="res://.godot/imported/phantom_camera_noise_emitter_gizmo.svg-9a593802655a8d5038c7f55deab3882d.s3tc.ctex" 7 | metadata={ 8 | "imported_formats": ["s3tc_bptc"], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/icons/phantom_camera_noise_emitter_gizmo.svg" 15 | dest_files=["res://.godot/imported/phantom_camera_noise_emitter_gizmo.svg-9a593802655a8d5038c7f55deab3882d.s3tc.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=true 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=0 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=false 38 | editor/convert_colors_with_editor_theme=false 39 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_resource.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_noise_resource.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://fudwitkewe70" 6 | path="res://.godot/imported/phantom_camera_noise_resource.svg-a81ed223714edd2c0d9cfa00be0c3f58.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_noise_resource.svg" 14 | dest_files=["res://.godot/imported/phantom_camera_noise_resource.svg-a81ed223714edd2c0d9cfa00be0c3f58.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_tween.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_tween.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dphl04mdf3220" 6 | path="res://.godot/imported/phantom_camera_tween.svg-16faced08ef4a5f3458264d894230dbd.ctex" 7 | metadata={ 8 | "has_editor_variant": true, 9 | "vram_texture": false 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://addons/phantom_camera/icons/phantom_camera_tween.svg" 15 | dest_files=["res://.godot/imported/phantom_camera_tween.svg-16faced08ef4a5f3458264d894230dbd.ctex"] 16 | 17 | [params] 18 | 19 | compress/mode=0 20 | compress/high_quality=false 21 | compress/lossy_quality=0.7 22 | compress/hdr_compression=1 23 | compress/normal_map=0 24 | compress/channel_pack=0 25 | mipmaps/generate=false 26 | mipmaps/limit=-1 27 | roughness/mode=0 28 | roughness/src_normal="" 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/normal_map_invert_y=false 32 | process/hdr_as_srgb=false 33 | process/hdr_clamp_exposure=false 34 | process/size_limit=0 35 | detect_3d/compress_to=1 36 | svg/scale=1.0 37 | editor/scale_with_editor_scale=false 38 | editor/convert_colors_with_editor_theme=true 39 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_updater_panel_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/phantom_camera_updater_panel_icon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://d4j4hrb7yusyq" 6 | path="res://.godot/imported/phantom_camera_updater_panel_icon.svg-19823e6cbee8115f8b2554d0ee6e79db.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/phantom_camera_updater_panel_icon.svg" 14 | dest_files=["res://.godot/imported/phantom_camera_updater_panel_icon.svg-19823e6cbee8115f8b2554d0ee6e79db.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/Camera2DIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/Camera2DIcon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://ccnsrg8hq74p2" 6 | path="res://.godot/imported/Camera2DIcon.svg-300e6f57281180711c5ecf391104d4ba.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/viewfinder/Camera2DIcon.svg" 14 | dest_files=["res://.godot/imported/Camera2DIcon.svg-300e6f57281180711c5ecf391104d4ba.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/Camera3DIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/Camera3DIcon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dkiefpjsrj37n" 6 | path="res://.godot/imported/Camera3DIcon.svg-4805c46004db1c89cc9443dd740693f5.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/viewfinder/Camera3DIcon.svg" 14 | dest_files=["res://.godot/imported/Camera3DIcon.svg-4805c46004db1c89cc9443dd740693f5.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/SceneTypesIcon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/SceneTypesIcon.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://dk7omm0x44suj" 6 | path="res://.godot/imported/SceneTypesIcon.svg-66e2255bd3398007bec03a5cbfa4d0aa.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/viewfinder/SceneTypesIcon.svg" 14 | dest_files=["res://.godot/imported/SceneTypesIcon.svg-66e2255bd3398007bec03a5cbfa4d0aa.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=1.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/Select.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/viewfinder/Select.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://rghrkoqrm2ig" 6 | path="res://.godot/imported/Select.svg-cdf90b8b400d3b91a023b70c6a823894.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/viewfinder/Select.svg" 14 | dest_files=["res://.godot/imported/Select.svg-cdf90b8b400d3b91a023b70c6a823894.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=2.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/warning.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /addons/phantom_camera/icons/warning.svg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="CompressedTexture2D" 5 | uid="uid://cjlv0bg7byjx0" 6 | path="res://.godot/imported/warning.svg-c1b21c265e0842bbdc9ed10735995366.ctex" 7 | metadata={ 8 | "vram_texture": false 9 | } 10 | 11 | [deps] 12 | 13 | source_file="res://addons/phantom_camera/icons/warning.svg" 14 | dest_files=["res://.godot/imported/warning.svg-c1b21c265e0842bbdc9ed10735995366.ctex"] 15 | 16 | [params] 17 | 18 | compress/mode=0 19 | compress/high_quality=false 20 | compress/lossy_quality=0.7 21 | compress/hdr_compression=1 22 | compress/normal_map=0 23 | compress/channel_pack=0 24 | mipmaps/generate=false 25 | mipmaps/limit=-1 26 | roughness/mode=0 27 | roughness/src_normal="" 28 | process/fix_alpha_border=true 29 | process/premult_alpha=false 30 | process/normal_map_invert_y=false 31 | process/hdr_as_srgb=false 32 | process/hdr_clamp_exposure=false 33 | process/size_limit=0 34 | detect_3d/compress_to=1 35 | svg/scale=2.0 36 | editor/scale_with_editor_scale=false 37 | editor/convert_colors_with_editor_theme=false 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/inspector/phantom_camera_inspector_plugin.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends EditorInspectorPlugin 3 | 4 | #var _phantom_camera_script: Script = preload("res://addons/phantom_camera/scripts/phantom_camera.gd") 5 | 6 | 7 | # TODO - Enable again once work is resumed for inspector based tasks 8 | 9 | #func _can_handle(object) -> bool: 10 | # return object is _phantom_camera_script 11 | 12 | 13 | func _parse_category(object: Object, category: String) -> void: 14 | 15 | var _margin_container: MarginContainer = MarginContainer.new() 16 | var _margin_v: float = 20 17 | _margin_container.add_theme_constant_override("margin_left", 10) 18 | _margin_container.add_theme_constant_override("margin_top", _margin_v) 19 | _margin_container.add_theme_constant_override("margin_right", 10) 20 | _margin_container.add_theme_constant_override("margin_bottom", _margin_v) 21 | add_custom_control(_margin_container) 22 | 23 | var _vbox_container: VBoxContainer = VBoxContainer.new() 24 | _margin_container.add_child(_vbox_container) 25 | 26 | var align_with_view_button = Button.new() 27 | align_with_view_button.connect("pressed", _align_camera_with_view.bind(object)) 28 | align_with_view_button.set_custom_minimum_size(Vector2(0, 60)) 29 | align_with_view_button.set_text("Align with view") 30 | _vbox_container.add_child(align_with_view_button) 31 | 32 | var preview_camera_button = Button.new() 33 | preview_camera_button.connect("pressed", _preview_camera.bind(object)) 34 | preview_camera_button.set_custom_minimum_size(Vector2(0, 60)) 35 | preview_camera_button.set_text("Preview Camera") 36 | _vbox_container.add_child(preview_camera_button) 37 | 38 | 39 | 40 | func _align_camera_with_view(object: Object) -> void: 41 | print("Aligning camera with view") 42 | print(object) 43 | 44 | func _preview_camera(object: Object) -> void: 45 | print("Previewing camera") 46 | print(object) 47 | -------------------------------------------------------------------------------- /addons/phantom_camera/inspector/phantom_camera_inspector_plugin.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dhwxgngr7sn6d 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/editor.gd.uid: -------------------------------------------------------------------------------- 1 | uid://ppret7j0jle7 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/editor.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://cfdoaceoosi1w"] 2 | 3 | [ext_resource type="Script" uid="uid://cgfwg3paxkj2x" path="res://addons/phantom_camera/scripts/panel/editor.gd" id="1_86hp7"] 4 | [ext_resource type="PackedScene" uid="uid://cuqkqsp3ikv5u" path="res://addons/phantom_camera/panel/updater/update_button.tscn" id="1_oowcd"] 5 | [ext_resource type="PackedScene" uid="uid://dbkr3d716wtx0" path="res://addons/phantom_camera/panel/viewfinder/viewfinder_panel.tscn" id="2_xecnk"] 6 | 7 | [node name="EditorPanel" type="VBoxContainer"] 8 | anchors_preset = 15 9 | anchor_right = 1.0 10 | anchor_bottom = 1.0 11 | grow_horizontal = 2 12 | grow_vertical = 2 13 | script = ExtResource("1_86hp7") 14 | 15 | [node name="UpdateButton" parent="." instance=ExtResource("1_oowcd")] 16 | unique_name_in_owner = true 17 | layout_mode = 2 18 | size_flags_horizontal = 8 19 | size_flags_vertical = 1 20 | 21 | [node name="ViewfinderPanel" parent="." instance=ExtResource("2_xecnk")] 22 | unique_name_in_owner = true 23 | layout_mode = 2 24 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/updater/update_button.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=3 uid="uid://cuqkqsp3ikv5u"] 2 | 3 | [ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="1_5e5k4"] 4 | [ext_resource type="Script" uid="uid://bwc42i46603qn" path="res://addons/phantom_camera/scripts/panel/updater/update_button.gd" id="1_xtaw5"] 5 | [ext_resource type="Texture2D" uid="uid://d4j4hrb7yusyq" path="res://addons/phantom_camera/icons/phantom_camera_updater_panel_icon.svg" id="2_c4d83"] 6 | [ext_resource type="PackedScene" uid="uid://b25fl4usw0nlp" path="res://addons/phantom_camera/panel/updater/download_update_panel.tscn" id="2_vtgcx"] 7 | 8 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c7fd1"] 9 | content_margin_left = 10.0 10 | content_margin_top = 4.0 11 | content_margin_right = 10.0 12 | content_margin_bottom = 4.0 13 | bg_color = Color(0.0980392, 0.415686, 0.341176, 1) 14 | border_width_left = 2 15 | border_width_top = 2 16 | border_width_right = 2 17 | border_width_bottom = 2 18 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 19 | corner_radius_top_left = 20 20 | corner_radius_top_right = 20 21 | corner_radius_bottom_right = 20 22 | corner_radius_bottom_left = 20 23 | 24 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y83dj"] 25 | content_margin_left = 10.0 26 | content_margin_top = 4.0 27 | content_margin_right = 10.0 28 | content_margin_bottom = 4.0 29 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 30 | border_width_left = 2 31 | border_width_top = 2 32 | border_width_right = 2 33 | border_width_bottom = 2 34 | border_color = Color(0.960784, 0.960784, 0.960784, 1) 35 | corner_radius_top_left = 20 36 | corner_radius_top_right = 20 37 | corner_radius_bottom_right = 20 38 | corner_radius_bottom_left = 20 39 | 40 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_slf6e"] 41 | 42 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_lekqh"] 43 | 44 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dr4n4"] 45 | content_margin_bottom = 20.0 46 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 47 | border_width_left = 2 48 | border_width_top = 2 49 | border_width_right = 2 50 | border_width_bottom = 2 51 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 52 | 53 | [node name="UpdateButton" type="Button"] 54 | visible = false 55 | offset_left = 1.0 56 | offset_right = 149.0 57 | offset_bottom = 28.0 58 | size_flags_vertical = 3 59 | theme_override_colors/font_color = Color(0.960784, 0.960784, 0.960784, 1) 60 | theme_override_colors/font_hover_color = Color(0.939288, 0.917743, 0.892615, 1) 61 | theme_override_colors/icon_normal_color = Color(0.960784, 0.960784, 0.960784, 1) 62 | theme_override_fonts/font = ExtResource("1_5e5k4") 63 | theme_override_font_sizes/font_size = 14 64 | theme_override_styles/normal = SubResource("StyleBoxFlat_c7fd1") 65 | theme_override_styles/hover = SubResource("StyleBoxFlat_y83dj") 66 | theme_override_styles/pressed = SubResource("StyleBoxEmpty_slf6e") 67 | theme_override_styles/focus = SubResource("StyleBoxEmpty_lekqh") 68 | text = "Update available" 69 | icon = ExtResource("2_c4d83") 70 | script = ExtResource("1_xtaw5") 71 | 72 | [node name="HTTPRequest" type="HTTPRequest" parent="."] 73 | unique_name_in_owner = true 74 | 75 | [node name="DownloadDialog" type="AcceptDialog" parent="."] 76 | unique_name_in_owner = true 77 | transparent_bg = true 78 | title = "New Update" 79 | initial_position = 2 80 | size = Vector2i(450, 480) 81 | transient = false 82 | unresizable = true 83 | borderless = true 84 | keep_title_visible = false 85 | content_scale_mode = 1 86 | theme_override_constants/buttons_separation = 30 87 | theme_override_styles/panel = SubResource("StyleBoxFlat_dr4n4") 88 | ok_button_text = "Close" 89 | 90 | [node name="DownloadUpdatePanel" parent="DownloadDialog" instance=ExtResource("2_vtgcx")] 91 | unique_name_in_owner = true 92 | offset_left = 2.0 93 | offset_top = 2.0 94 | offset_right = -2.0 95 | offset_bottom = -80.0 96 | 97 | [node name="NeedsReloadDialog" type="ConfirmationDialog" parent="."] 98 | unique_name_in_owner = true 99 | 100 | [node name="UpdateFailedDialog" type="AcceptDialog" parent="."] 101 | unique_name_in_owner = true 102 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/viewfinder/deadzone_style_box.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="StyleBoxFlat" format=3 uid="uid://dpa7yvxlq043a"] 2 | 3 | [resource] 4 | bg_color = Color(0.227451, 0.72549, 0.603922, 0.2) 5 | border_width_left = 2 6 | border_width_top = 2 7 | border_width_right = 2 8 | border_width_bottom = 2 9 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 10 | corner_detail = 1 11 | expand_margin_left = 1.0 12 | expand_margin_top = 1.0 13 | expand_margin_right = 1.0 14 | expand_margin_bottom = 1.0 15 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/viewfinder/host_list/host_list.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=3 uid="uid://mbjdav5oqves"] 2 | 3 | [ext_resource type="Script" uid="uid://c84cxry3t35ny" path="res://addons/phantom_camera/scripts/panel/viewfinder/host_list.gd" id="1_h6ayt"] 4 | [ext_resource type="Texture2D" uid="uid://5fatldiu7dd5" path="res://addons/phantom_camera/icons/phantom_camera_host.svg" id="1_xlgqb"] 5 | 6 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_w002y"] 7 | 8 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kq7gm"] 9 | content_margin_left = 8.0 10 | content_margin_top = 4.0 11 | content_margin_right = 8.0 12 | content_margin_bottom = 4.0 13 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 14 | border_width_top = 2 15 | border_width_right = 2 16 | border_color = Color(0.960784, 0.960784, 0.960784, 1) 17 | corner_radius_top_right = 8 18 | 19 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ynag5"] 20 | content_margin_left = 8.0 21 | content_margin_top = 4.0 22 | content_margin_right = 8.0 23 | content_margin_bottom = 4.0 24 | bg_color = Color(0.960784, 0.960784, 0.960784, 1) 25 | border_width_top = 2 26 | border_width_right = 2 27 | border_width_bottom = 2 28 | corner_radius_top_right = 6 29 | 30 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q2svd"] 31 | content_margin_left = 8.0 32 | content_margin_top = 4.0 33 | content_margin_right = 8.0 34 | content_margin_bottom = 4.0 35 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 36 | border_width_top = 2 37 | border_width_right = 2 38 | border_width_bottom = 2 39 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 40 | corner_radius_top_right = 8 41 | 42 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_e0jvt"] 43 | content_margin_left = 0.0 44 | content_margin_top = 8.0 45 | content_margin_right = 0.0 46 | content_margin_bottom = 8.0 47 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 48 | border_width_top = 2 49 | border_width_right = 2 50 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 51 | corner_radius_top_right = 10 52 | 53 | [node name="PCamHostList" type="VBoxContainer"] 54 | anchors_preset = 9 55 | anchor_bottom = 1.0 56 | size_flags_horizontal = 0 57 | size_flags_vertical = 0 58 | theme_override_constants/separation = -2 59 | alignment = 2 60 | script = ExtResource("1_h6ayt") 61 | 62 | [node name="HostListButton" type="Button" parent="."] 63 | unique_name_in_owner = true 64 | custom_minimum_size = Vector2(40, 40) 65 | layout_mode = 2 66 | size_flags_horizontal = 0 67 | theme_override_colors/icon_hover_color = Color(0.0784314, 0.109804, 0.129412, 1) 68 | theme_override_colors/icon_hover_pressed_color = Color(0.0784314, 0.109804, 0.129412, 1) 69 | theme_override_styles/focus = SubResource("StyleBoxEmpty_w002y") 70 | theme_override_styles/hover_pressed = SubResource("StyleBoxFlat_kq7gm") 71 | theme_override_styles/hover = SubResource("StyleBoxFlat_ynag5") 72 | theme_override_styles/pressed = SubResource("StyleBoxFlat_kq7gm") 73 | theme_override_styles/normal = SubResource("StyleBoxFlat_q2svd") 74 | icon = ExtResource("1_xlgqb") 75 | expand_icon = true 76 | 77 | [node name="ScrollContainer" type="ScrollContainer" parent="."] 78 | unique_name_in_owner = true 79 | layout_mode = 2 80 | size_flags_vertical = 3 81 | theme_override_styles/panel = SubResource("StyleBoxFlat_e0jvt") 82 | horizontal_scroll_mode = 0 83 | 84 | [node name="HostListContainer" type="VBoxContainer" parent="ScrollContainer"] 85 | unique_name_in_owner = true 86 | layout_mode = 2 87 | theme_override_constants/separation = 8 88 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/viewfinder/host_list/host_list_item.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=3 uid="uid://btn6jgv0vix7"] 2 | 3 | [ext_resource type="FontFile" uid="uid://dve7mgsjik4dg" path="res://addons/phantom_camera/fonts/Nunito-Regular.ttf" id="1_anjxo"] 4 | [ext_resource type="Theme" uid="uid://bhppejri5dbsf" path="res://addons/phantom_camera/themes/theme.tres" id="1_wql5t"] 5 | [ext_resource type="Texture2D" uid="uid://rghrkoqrm2ig" path="res://addons/phantom_camera/icons/viewfinder/Select.svg" id="2_71b6g"] 6 | [ext_resource type="ButtonGroup" uid="uid://dfu0b8jbtyr1n" path="res://addons/phantom_camera/panel/viewfinder/host_list/host_list_item_group.tres" id="3_06a0y"] 7 | [ext_resource type="Script" uid="uid://bv24ubx8mutw7" path="res://addons/phantom_camera/scripts/panel/viewfinder/host_list_item.gd" id="3_a5o8b"] 8 | [ext_resource type="Texture2D" uid="uid://cjlv0bg7byjx0" path="res://addons/phantom_camera/icons/warning.svg" id="3_qgpy7"] 9 | 10 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0rxfi"] 11 | content_margin_right = 6.0 12 | 13 | [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_llqnh"] 14 | 15 | [sub_resource type="Theme" id="Theme_7h15c"] 16 | Button/colors/icon_hover_color = Color(0.960784, 0.960784, 0.960784, 1) 17 | Button/colors/icon_hover_pressed_color = Color(0.227451, 0.72549, 0.603922, 1) 18 | Button/colors/icon_normal_color = Color(0.227451, 0.72549, 0.603922, 1) 19 | Button/colors/icon_pressed_color = Color(0.227451, 0.72549, 0.603922, 1) 20 | Button/constants/icon_max_width = 20 21 | Button/styles/focus = SubResource("StyleBoxEmpty_llqnh") 22 | 23 | [node name="HostListItem" type="PanelContainer"] 24 | offset_right = 229.0 25 | offset_bottom = 34.0 26 | theme_override_styles/panel = SubResource("StyleBoxEmpty_0rxfi") 27 | script = ExtResource("3_a5o8b") 28 | 29 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 30 | layout_mode = 2 31 | theme_override_constants/separation = 2 32 | 33 | [node name="SelectPCamHost" type="Button" parent="HBoxContainer"] 34 | unique_name_in_owner = true 35 | layout_mode = 2 36 | size_flags_vertical = 4 37 | tooltip_text = "Select the Phantom Camera Host node from the scene hierarchy" 38 | focus_mode = 0 39 | theme = SubResource("Theme_7h15c") 40 | icon = ExtResource("2_71b6g") 41 | flat = true 42 | 43 | [node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer"] 44 | layout_mode = 2 45 | theme_override_constants/separation = 8 46 | 47 | [node name="ErrorPCamHost" type="TextureRect" parent="HBoxContainer/HBoxContainer"] 48 | unique_name_in_owner = true 49 | custom_minimum_size = Vector2(18, 18) 50 | layout_mode = 2 51 | size_flags_horizontal = 3 52 | size_flags_vertical = 4 53 | tooltip_text = "This Phantom Camera Host node will not affect a Camera node. 54 | See the warning in the Scene Tree for more information." 55 | texture = ExtResource("3_qgpy7") 56 | expand_mode = 1 57 | 58 | [node name="SwitchPCamHost" type="Button" parent="HBoxContainer/HBoxContainer"] 59 | unique_name_in_owner = true 60 | custom_minimum_size = Vector2(40, 0) 61 | layout_mode = 2 62 | tooltip_text = "Change the viewfinder's camera to the camera of this Phantom Camera Host" 63 | theme = ExtResource("1_wql5t") 64 | theme_override_fonts/font = ExtResource("1_anjxo") 65 | theme_override_font_sizes/font_size = 18 66 | toggle_mode = true 67 | button_group = ExtResource("3_06a0y") 68 | text = "{ PCamHostName }" 69 | -------------------------------------------------------------------------------- /addons/phantom_camera/panel/viewfinder/host_list/host_list_item_group.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ButtonGroup" format=3 uid="uid://dfu0b8jbtyr1n"] 2 | 3 | [resource] 4 | -------------------------------------------------------------------------------- /addons/phantom_camera/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="Phantom Camera" 4 | description="Control the movement and dynamically tween 2D & 3D cameras positions. Built for Godot 4. Inspired by Cinemachine." 5 | author="Marcus Skov" 6 | version="0.9.2" 7 | script="plugin.gd" 8 | -------------------------------------------------------------------------------- /addons/phantom_camera/plugin.gd.uid: -------------------------------------------------------------------------------- 1 | uid://c7g41in1osxi6 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/gizmos/phantom_camera_3d_gizmo.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends EditorNode3DGizmo 3 | 4 | #var pcam_3d: PhantomCamera3D 5 | 6 | func _redraw() -> void: 7 | clear() 8 | 9 | var icon: Material = get_plugin().get_material(get_plugin().get_name(), self) 10 | add_unscaled_billboard(icon, 0.035) 11 | 12 | var pcam_3d: PhantomCamera3D = get_node_3d() 13 | 14 | # if pcam_3d.is_following(): 15 | # _draw_target(pcam_3d, pcam_3d.get_follow_target_position(), "follow_target") 16 | # if pcam_3d.is_looking_at(): 17 | # _draw_target(pcam_3d, pcam_3d.get_look_at_target_position(), "look_at_target") 18 | 19 | if pcam_3d.is_active(): return 20 | 21 | var frustum_lines: PackedVector3Array = PackedVector3Array() 22 | var height: float = 0.25 23 | var width: float = height * 1.25 24 | var forward: float = height * -1.5 25 | 26 | # Trapezoid 27 | frustum_lines.push_back(Vector3.ZERO) 28 | frustum_lines.push_back(Vector3(-width, height, forward)) 29 | 30 | frustum_lines.push_back(Vector3.ZERO) 31 | frustum_lines.push_back(Vector3(width, height, forward)) 32 | 33 | frustum_lines.push_back(Vector3.ZERO) 34 | frustum_lines.push_back(Vector3(-width, -height, forward)) 35 | 36 | frustum_lines.push_back(Vector3.ZERO) 37 | frustum_lines.push_back(Vector3(width, -height, forward)) 38 | 39 | ####### 40 | # Frame 41 | ####### 42 | ## Left 43 | frustum_lines.push_back(Vector3(-width, height, forward)) 44 | frustum_lines.push_back(Vector3(-width, -height, forward)) 45 | 46 | ## Bottom 47 | frustum_lines.push_back(Vector3(-width, -height, forward)) 48 | frustum_lines.push_back(Vector3(width, -height, forward)) 49 | 50 | ## Right 51 | frustum_lines.push_back(Vector3(width, -height, forward)) 52 | frustum_lines.push_back(Vector3(width, height, forward)) 53 | 54 | ## Top 55 | frustum_lines.push_back(Vector3(width, height, forward)) 56 | frustum_lines.push_back(Vector3(-width, height, forward)) 57 | 58 | ############## 59 | # Up Direction 60 | ############## 61 | var up_height: float = height + 0.15 62 | var up_width: float = width / 3 63 | 64 | ## Left 65 | frustum_lines.push_back(Vector3(0, up_height, forward)) 66 | frustum_lines.push_back(Vector3(-up_width, height, forward)) 67 | 68 | ## Right 69 | frustum_lines.push_back(Vector3(0, up_height, forward)) 70 | frustum_lines.push_back(Vector3(up_width, height, forward)) 71 | 72 | var frustum_material: StandardMaterial3D = get_plugin().get_material("frustum", self) 73 | add_lines(frustum_lines, frustum_material, false) 74 | 75 | 76 | func _draw_target(pcam_3d: Node3D, target_position: Vector3, type: String) -> void: 77 | var target_lines: PackedVector3Array = PackedVector3Array() 78 | var direction: Vector3 = target_position - pcam_3d.global_position 79 | var end_position: Vector3 = pcam_3d.global_basis.z * direction 80 | 81 | target_lines.push_back(Vector3.ZERO) 82 | target_lines.push_back(end_position) 83 | var target_material: StandardMaterial3D = get_plugin().get_material(type, self) 84 | add_lines(target_lines, target_material, false) 85 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/gizmos/phantom_camera_3d_gizmo.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cyr6fgximfw6q 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/gizmos/phantom_camera_3d_gizmo_plugin.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends EditorNode3DGizmoPlugin 3 | 4 | const PhantomCamera3DNode: Script = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd") 5 | const PhantomCamera3DGizmo: Script = preload("res://addons/phantom_camera/scripts/gizmos/phantom_camera_3d_gizmo.gd") 6 | const _icon_texture: Texture2D = preload("res://addons/phantom_camera/icons/phantom_camera_gizmo.svg") 7 | var _gizmo_name: String = "PhantomCamera3D" 8 | 9 | var gizmo_name: String: set = set_gizmo_name 10 | var _gizmo_icon: Texture2D 11 | var _gizmo_spatial_script: Script = PhantomCamera3DNode 12 | 13 | 14 | func set_gizmo_name(name: String) -> void: 15 | _gizmo_name = name 16 | 17 | 18 | func _get_gizmo_name() -> String: 19 | return _gizmo_name 20 | 21 | 22 | func _has_gizmo(spatial: Node3D) -> bool: 23 | return spatial is PhantomCamera3D 24 | 25 | 26 | func _init() -> void: 27 | create_icon_material(gizmo_name, _icon_texture, false, Color.WHITE) 28 | create_material("frustum", Color8(252, 127, 127, 255)) 29 | create_material("follow_target", Color8(185, 58, 89)) 30 | create_material("look_at_target", Color8(61, 207, 225)) 31 | 32 | 33 | func _create_gizmo(for_node_3d: Node3D) -> EditorNode3DGizmo: 34 | if for_node_3d is PhantomCamera3DNode: 35 | return PhantomCamera3DGizmo.new() 36 | else: 37 | return null 38 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/gizmos/phantom_camera_3d_gizmo_plugin.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bkevga3bx4rfj 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/gizmos/phantom_camera_noise_emitter_gizmo_plugin_3d.gd: -------------------------------------------------------------------------------- 1 | extends EditorNode3DGizmoPlugin 2 | 3 | var _spatial_script: Script = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_noise_emitter_3d.gd") 4 | var _gizmo_icon: Texture2D = preload("res://addons/phantom_camera/icons/phantom_camera_noise_emitter_gizmo.svg") 5 | 6 | var _gizmo_name: StringName = "PhantomCameraNoiseEmitter" 7 | 8 | func _init() -> void: 9 | create_material("main", Color8(252, 127, 127, 255)) 10 | create_handle_material("handles") 11 | create_icon_material(_gizmo_name, _gizmo_icon, false, Color.WHITE) 12 | 13 | 14 | func _has_gizmo(node: Node3D): 15 | return node.get_script() == _spatial_script 16 | 17 | 18 | func _get_gizmo_name() -> String: 19 | return _gizmo_name 20 | 21 | 22 | func _redraw(gizmo: EditorNode3DGizmo): 23 | gizmo.clear() 24 | 25 | var icon: Material = get_material(_gizmo_name, gizmo) 26 | gizmo.add_unscaled_billboard(icon, 0.035) 27 | 28 | #var material = get_material("main", gizmo) 29 | #gizmo.add_lines(_draw_frustum(), material) 30 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/gizmos/phantom_camera_noise_emitter_gizmo_plugin_3d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dddokcd2ug05i 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/managers/PhantomCameraManager.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Godot; 3 | 4 | #nullable enable 5 | 6 | namespace PhantomCamera.Manager; 7 | 8 | public static class PhantomCameraManager 9 | { 10 | private static GodotObject? _instance; 11 | 12 | public static GodotObject Instance => _instance ??= Engine.GetSingleton("PhantomCameraManager"); 13 | 14 | public static PhantomCamera2D[] PhantomCamera2Ds => 15 | Instance.Call(MethodName.GetPhantomCamera2Ds).AsGodotArray() 16 | .Select(node => new PhantomCamera2D(node)).ToArray(); 17 | 18 | public static PhantomCamera3D[] PhantomCamera3Ds => 19 | Instance.Call(MethodName.GetPhantomCamera3Ds).AsGodotArray() 20 | .Select(node => new PhantomCamera3D(node)).ToArray(); 21 | 22 | public static PhantomCameraHost[] PhantomCameraHosts => 23 | Instance.Call(MethodName.GetPhantomCameraHosts).AsGodotArray() 24 | .Select(node => new PhantomCameraHost(node)).ToArray(); 25 | 26 | public static PhantomCamera2D[] GetPhantomCamera2Ds() => PhantomCamera2Ds; 27 | public static PhantomCamera3D[] GetPhantomCamera3Ds() => PhantomCamera3Ds; 28 | public static PhantomCameraHost[] GetPhantomCameraHosts() => PhantomCameraHosts; 29 | 30 | public static class MethodName 31 | { 32 | public const string GetPhantomCamera2Ds = "get_phantom_camera_2ds"; 33 | public const string GetPhantomCamera3Ds = "get_phantom_camera_3ds"; 34 | public const string GetPhantomCameraHosts = "get_phantom_camera_hosts"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/managers/PhantomCameraManager.cs.uid: -------------------------------------------------------------------------------- 1 | uid://vtj8iqx4bp43 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/managers/phantom_camera_manager.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends Node 3 | 4 | const _CONSTANTS = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd") 5 | 6 | #region Signals 7 | 8 | # Noise 9 | signal noise_2d_emitted(noise_output: Transform2D, emitter_layer: int) 10 | signal noise_3d_emitted(noise_output: Transform3D, emitter_layer: int) 11 | 12 | # PCam Host 13 | signal pcam_host_added_to_scene(pcam_host: PhantomCameraHost) 14 | signal pcam_host_removed_from_scene(pcam_host: PhantomCameraHost) 15 | 16 | # PCam 17 | signal pcam_added_to_scene(pcam: Node) 18 | signal pcam_removed_from_scene(pcam: Node) 19 | 20 | # Priority 21 | signal pcam_priority_changed(pcam: Node) 22 | signal pcam_visibility_changed(pcam: Node) 23 | 24 | signal pcam_teleport(pcam: Node) 25 | 26 | # Limit (2D) 27 | signal limit_2d_changed(side: int, limit: int) 28 | signal draw_limit_2d(enabled: bool) 29 | 30 | # Camera3DResource (3D) 31 | signal camera_3d_resource_changed(property: String, value: Variant) 32 | 33 | # Viewfinder Signals 34 | signal viewfinder_pcam_host_switch(pcam_host: PhantomCameraHost) 35 | signal pcam_priority_override(pcam: Node, shouldOverride: bool) 36 | signal pcam_dead_zone_changed(pcam: Node) 37 | signal pcam_host_layer_changed(pcam: Node) 38 | 39 | #endregion 40 | 41 | #region Private Variables 42 | 43 | var _phantom_camera_host_list: Array[PhantomCameraHost] 44 | var _phantom_camera_2d_list: Array[PhantomCamera2D] 45 | var _phantom_camera_3d_list: Array[Node] ## Note: To support disable_3d export templates for 2D projects, this is purposely not strongly typed. 46 | 47 | #endregion 48 | 49 | #region Public Variables 50 | 51 | var phantom_camera_hosts: Array[PhantomCameraHost]: 52 | get: 53 | return _phantom_camera_host_list 54 | 55 | var phantom_camera_2ds: Array[PhantomCamera2D]: 56 | get: 57 | return _phantom_camera_2d_list 58 | 59 | var phantom_camera_3ds: Array[Node]: ## Note: To support disable_3d export templates for 2D projects, this is purposely not strongly typed. 60 | get: 61 | return _phantom_camera_3d_list 62 | 63 | var screen_size: Vector2i 64 | 65 | #endregion 66 | 67 | #region Private Functions 68 | 69 | func _enter_tree() -> void: 70 | if not Engine.has_singleton(_CONSTANTS.PCAM_MANAGER_NODE_NAME): 71 | Engine.register_singleton(_CONSTANTS.PCAM_MANAGER_NODE_NAME, self) 72 | Engine.physics_jitter_fix = 0 73 | 74 | 75 | func _ready() -> void: 76 | # Setting default screensize 77 | screen_size = Vector2i( 78 | ProjectSettings.get_setting("display/window/size/viewport_width"), 79 | ProjectSettings.get_setting("display/window/size/viewport_height") 80 | ) 81 | 82 | # For editor 83 | if Engine.is_editor_hint(): 84 | ProjectSettings.settings_changed.connect(func(): 85 | screen_size = Vector2i( 86 | ProjectSettings.get_setting("display/window/size/viewport_width"), 87 | ProjectSettings.get_setting("display/window/size/viewport_height") 88 | ) 89 | ) 90 | # For runtime 91 | else: 92 | get_tree().get_root().size_changed.connect(func(): 93 | screen_size = get_viewport().get_visible_rect().size 94 | ) 95 | 96 | #endregion 97 | 98 | #region Public Functions 99 | 100 | func pcam_host_added(caller: Node) -> void: 101 | if is_instance_of(caller, PhantomCameraHost): 102 | _phantom_camera_host_list.append(caller) 103 | pcam_host_added_to_scene.emit(caller) 104 | else: 105 | printerr("This method can only be called from a PhantomCameraHost node") 106 | 107 | func pcam_host_removed(caller: Node) -> void: 108 | if is_instance_of(caller, PhantomCameraHost): 109 | _phantom_camera_host_list.erase(caller) 110 | pcam_host_removed_from_scene.emit(caller) 111 | else: 112 | printerr("This method can only be called from a PhantomCameraHost node") 113 | 114 | 115 | func pcam_added(caller) -> void: 116 | if is_instance_of(caller, PhantomCamera2D): 117 | _phantom_camera_2d_list.append(caller) 118 | pcam_added_to_scene.emit(caller) 119 | elif caller.is_class("PhantomCamera3D"): ## Note: To support disable_3d export templates for 2D projects, this is purposely not strongly typed. 120 | _phantom_camera_3d_list.append(caller) 121 | pcam_added_to_scene.emit(caller) 122 | 123 | func pcam_removed(caller) -> void: 124 | if is_instance_of(caller, PhantomCamera2D): 125 | _phantom_camera_2d_list.erase(caller) 126 | pcam_removed_from_scene.emit(caller) 127 | elif caller.is_class("PhantomCamera3D"): ## Note: To support disable_3d export templates for 2D projects, this is purposely not strongly typed. 128 | _phantom_camera_3d_list.erase(caller) 129 | pcam_removed_from_scene.emit(caller) 130 | else: 131 | printerr("This method can only be called from a PhantomCamera node") 132 | 133 | 134 | func get_phantom_camera_hosts() -> Array[PhantomCameraHost]: 135 | return _phantom_camera_host_list 136 | 137 | func get_phantom_camera_2ds() -> Array[PhantomCamera2D]: 138 | return _phantom_camera_2d_list 139 | 140 | func get_phantom_camera_3ds() -> Array: ## Note: To support disable_3d export templates for 2D projects, this is purposely not strongly typed. 141 | return _phantom_camera_3d_list 142 | 143 | 144 | func scene_changed() -> void: 145 | _phantom_camera_2d_list.clear() 146 | _phantom_camera_3d_list.clear() 147 | _phantom_camera_host_list.clear() 148 | 149 | #endregion 150 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/managers/phantom_camera_manager.gd.uid: -------------------------------------------------------------------------------- 1 | uid://duq6jhf6unyis 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/editor.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends VBoxContainer 3 | 4 | #region Onready 5 | 6 | @onready var updater: Control = %UpdateButton 7 | @onready var viewfinder: Control = %ViewfinderPanel 8 | 9 | #endregion 10 | 11 | #region Public Variables 12 | 13 | var editor_plugin: EditorPlugin 14 | 15 | #endregion 16 | 17 | 18 | #region Private Functions 19 | 20 | func _ready(): 21 | updater.editor_plugin = editor_plugin 22 | 23 | #endregion 24 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/editor.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cgfwg3paxkj2x 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/updater/download_update_panel.gd: -------------------------------------------------------------------------------- 1 | ####################################################################### 2 | # Credit goes to the Dialogue Manager plugin for this script 3 | # Check it out at: https://github.com/nathanhoad/godot_dialogue_manager 4 | ####################################################################### 5 | 6 | @tool 7 | extends Control 8 | 9 | #region Constants 10 | 11 | const TEMP_FILE_NAME = "user://temp.zip" 12 | 13 | #endregion 14 | 15 | 16 | #region Signals 17 | 18 | signal failed() 19 | signal updated(updated_to_version: String) 20 | 21 | #endregion 22 | 23 | 24 | #region @onready 25 | 26 | #@onready var logo: TextureRect = %Logo 27 | @onready var _download_verion: Label = %DownloadVersionLabel 28 | @onready var _download_http_request: HTTPRequest = %DownloadHTTPRequest 29 | @onready var _download_button: Button = %DownloadButton 30 | @onready var _download_button_bg: NinePatchRect = %DownloadButtonBG 31 | @onready var _download_label: Label = %UpdateLabel 32 | 33 | @onready var _breaking_label: Label = %BreakingLabel 34 | @onready var _breaking_margin_container: MarginContainer = %BreakingMarginContainer 35 | @onready var _breaking_options_button: OptionButton = %BreakingOptionButton 36 | #@onready var current_version_label: Label = %CurrentVersionLabel 37 | 38 | #endregion 39 | 40 | 41 | #region Variables 42 | 43 | # Todo - For 4.2 upgrade - Shows current version 44 | var _download_dialogue: AcceptDialog 45 | var _button_texture_default: Texture2D = load("res://addons/phantom_camera/assets/PhantomCameraBtnPrimaryDefault.png") 46 | var _button_texture_hover: Texture2D = load("res://addons/phantom_camera/assets/PhantomCameraBtnPrimaryHover.png") 47 | 48 | var next_version_release: Dictionary: 49 | set(value): 50 | next_version_release = value 51 | _download_verion.text = "%s update is available for download" % value.tag_name.substr(1) 52 | # Todo - For 4.2 upgrade 53 | #current_version_label.text = "Current version is " + editor_plugin.get_version() 54 | get: 55 | return next_version_release 56 | 57 | var _breaking_window_height: float = 520 58 | var _breaking_window_height_update: float = 600 59 | 60 | #endregion 61 | 62 | 63 | #region Private Functions 64 | 65 | func _ready() -> void: 66 | _download_http_request.request_completed.connect(_on_http_request_request_completed) 67 | _download_button.pressed.connect(_on_download_button_pressed) 68 | _download_button.mouse_entered.connect(_on_mouse_entered) 69 | _download_button.mouse_exited.connect(_on_mouse_exited) 70 | 71 | _breaking_label.hide() 72 | _breaking_margin_container.hide() 73 | _breaking_options_button.hide() 74 | 75 | _breaking_options_button.item_selected.connect(_on_item_selected) 76 | 77 | 78 | func _on_item_selected(index: int) -> void: 79 | if index == 1: 80 | _download_button.show() 81 | _download_dialogue.size = Vector2(_download_dialogue.size.x, _breaking_window_height_update) 82 | else: 83 | _download_button.hide() 84 | _download_dialogue.size = Vector2(_download_dialogue.size.x, _breaking_window_height) 85 | 86 | 87 | func _on_download_button_pressed() -> void: 88 | _download_http_request.request(next_version_release.zipball_url) 89 | _download_button.disabled = true 90 | _download_label.text = "Downloading..." 91 | _download_button_bg.hide() 92 | 93 | 94 | func _on_mouse_entered() -> void: 95 | _download_button_bg.set_texture(_button_texture_hover) 96 | 97 | 98 | func _on_mouse_exited() -> void: 99 | _download_button_bg.set_texture(_button_texture_default) 100 | 101 | 102 | func _on_http_request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void: 103 | if result != HTTPRequest.RESULT_SUCCESS: 104 | failed.emit() 105 | return 106 | 107 | # Save the downloaded zip 108 | var zip_file: FileAccess = FileAccess.open(TEMP_FILE_NAME, FileAccess.WRITE) 109 | zip_file.store_buffer(body) 110 | zip_file.close() 111 | 112 | OS.move_to_trash(ProjectSettings.globalize_path("res://addons/phantom_camera")) 113 | 114 | var zip_reader: ZIPReader = ZIPReader.new() 115 | zip_reader.open(TEMP_FILE_NAME) 116 | var files: PackedStringArray = zip_reader.get_files() 117 | 118 | var base_path = files[1] 119 | # Remove archive folder 120 | files.remove_at(0) 121 | # Remove assets folder 122 | files.remove_at(0) 123 | 124 | for path in files: 125 | var new_file_path: String = path.replace(base_path, "") 126 | if path.ends_with("/"): 127 | DirAccess.make_dir_recursive_absolute("res://addons/%s" % new_file_path) 128 | else: 129 | var file: FileAccess = FileAccess.open("res://addons/%s" % new_file_path, FileAccess.WRITE) 130 | file.store_buffer(zip_reader.read_file(path)) 131 | 132 | zip_reader.close() 133 | DirAccess.remove_absolute(TEMP_FILE_NAME) 134 | 135 | updated.emit(next_version_release.tag_name.substr(1)) 136 | 137 | 138 | func _on_notes_button_pressed() -> void: 139 | OS.shell_open(next_version_release.html_url) 140 | 141 | #endregion 142 | 143 | #region Public Functions 144 | 145 | func show_updater_warning(next_version_number: Array, current_version_number: Array) -> void: 146 | var current_version_number_0: int = current_version_number[0] as int 147 | var current_version_number_1: int = current_version_number[1] as int 148 | 149 | var next_version_number_0: int = next_version_number[0] as int # Major release number in the new release 150 | var next_version_number_1: int = next_version_number[1] as int # Minor release number in the new release 151 | 152 | if next_version_number_0 > current_version_number_0 or \ 153 | next_version_number_1 > current_version_number_1: 154 | _breaking_label.show() 155 | _breaking_margin_container.show() 156 | _breaking_options_button.show() 157 | _download_button.hide() 158 | 159 | _download_dialogue = get_parent() 160 | _download_dialogue.size = Vector2(_download_dialogue.size.x, _breaking_window_height) 161 | 162 | #endregion 163 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/updater/download_update_panel.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cjblcocen12r3 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/updater/update_button.gd: -------------------------------------------------------------------------------- 1 | ####################################################################### 2 | # Credit goes to the Dialogue Manager plugin for this script 3 | # Check it out at: https://github.com/nathanhoad/godot_dialogue_manager 4 | ####################################################################### 5 | 6 | @tool 7 | extends Button 8 | 9 | #region Constants 10 | 11 | const REMOTE_RELEASE_URL: StringName = "https://api.github.com/repos/ramokz/phantom-camera/releases" 12 | const UPDATER_CONSTANTS := preload("res://addons/phantom_camera/scripts/panel/updater/updater_constants.gd") 13 | 14 | #endregion 15 | 16 | 17 | #region @onready 18 | 19 | @onready var http_request: HTTPRequest = %HTTPRequest 20 | @onready var download_dialog: AcceptDialog = %DownloadDialog 21 | @onready var download_update_panel: Control = %DownloadUpdatePanel 22 | @onready var needs_reload_dialog: AcceptDialog = %NeedsReloadDialog 23 | @onready var update_failed_dialog: AcceptDialog = %UpdateFailedDialog 24 | 25 | #endregion 26 | 27 | 28 | #region Variables 29 | 30 | # The main editor plugin 31 | var editor_plugin: EditorPlugin 32 | 33 | var needs_reload: bool = false 34 | 35 | # A lambda that gets called just before refreshing the plugin. Return false to stop the reload. 36 | var on_before_refresh: Callable = func(): return true 37 | 38 | #endregion 39 | 40 | 41 | #region Private Functions 42 | 43 | func _ready() -> void: 44 | hide() 45 | 46 | # Check for updates on GitHub Releases 47 | check_for_update() 48 | 49 | pressed.connect(_on_update_button_pressed) 50 | http_request.request_completed.connect(_request_request_completed) 51 | download_update_panel.updated.connect(_on_download_update_panel_updated) 52 | needs_reload_dialog.confirmed.connect(_on_needs_reload_dialog_confirmed) 53 | 54 | 55 | func _request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void: 56 | if result != HTTPRequest.RESULT_SUCCESS: return 57 | 58 | if not editor_plugin: return 59 | var current_version: String = editor_plugin.get_version() 60 | 61 | # Work out the next version from the releases information on GitHub 62 | var response: Array = JSON.parse_string(body.get_string_from_utf8()) 63 | if typeof(response) != TYPE_ARRAY: return 64 | 65 | # GitHub releases are in order of creation, not order of version 66 | var versions: Array = response.filter(func(release): 67 | var version: String = release.tag_name.substr(1) 68 | return version_to_number(version) > version_to_number(current_version) 69 | ) 70 | 71 | if versions.size() > 0: 72 | if ProjectSettings.get_setting(UPDATER_CONSTANTS.setting_updater_mode) == 1: ## For console output mode 73 | 74 | print_rich(" 75 | [color=#3AB99A] ********[/color] 76 | [color=#3AB99A] ************[/color] 77 | [color=#3AB99A]**************[/color] 78 | [color=#3AB99A]****** *** *[/color] 79 | [color=#3AB99A]****** ***[/color] 80 | [color=#3AB99A]********** *****[/color] 81 | [color=#3AB99A]******** ***********[/color] 82 | [color=#3AB99A]******** *********** **[/color] 83 | [color=#3AB99A]********* **************[/color] 84 | [color=#3AB99A]********** *************[/color] 85 | [color=#3AB99A]** ** ** ******* **[/color] 86 | [font_size=18][b]New Phantom Camera version is available[/b][/font_size]") 87 | 88 | if FileAccess.file_exists("res://dev_scenes/3d/dev_scene_3d.tscn"): 89 | print_rich("[font_size=14][color=#EAA15E][b]As you're using a fork of the project, you will need to update it manually[/b][/color][/font_size]") 90 | 91 | print_rich("[font_size=12]If you don't want to see this message, then it can be disabled inside:\n[code]Project Settings/Phantom Camera/Updater/Show New Release Info on Editor Launch in Output[/code]") 92 | 93 | return 94 | 95 | download_update_panel.next_version_release = versions[0] 96 | download_update_panel.show_updater_warning( 97 | versions[0].tag_name.substr(1).split("."), 98 | current_version.split(".") 99 | ) 100 | _set_scale() 101 | editor_plugin.panel_button.add_theme_color_override("font_color", Color("#3AB99A")) 102 | editor_plugin.panel_button.icon = load("res://addons/phantom_camera/icons/phantom_camera_updater_panel_icon.svg") 103 | editor_plugin.panel_button.add_theme_color_override("icon_normal_color", Color("#3AB99A")) 104 | show() 105 | 106 | 107 | func _on_update_button_pressed() -> void: 108 | if needs_reload: 109 | var will_refresh = on_before_refresh.call() 110 | if will_refresh: 111 | EditorInterface.restart_editor(true) 112 | else: 113 | _set_scale() 114 | download_dialog.popup_centered() 115 | 116 | 117 | func _set_scale() -> void: 118 | var scale: float = EditorInterface.get_editor_scale() 119 | download_dialog.min_size = Vector2(300, 250) * scale 120 | 121 | 122 | func _on_download_dialog_close_requested() -> void: 123 | download_dialog.hide() 124 | 125 | 126 | func _on_download_update_panel_updated(updated_to_version: String) -> void: 127 | download_dialog.hide() 128 | 129 | needs_reload_dialog.dialog_text = "Reload to finish update" 130 | needs_reload_dialog.ok_button_text = "Reload" 131 | needs_reload_dialog.cancel_button_text = "Cancel" 132 | needs_reload_dialog.popup_centered() 133 | 134 | needs_reload = true 135 | text = "Reload Project" 136 | 137 | 138 | func _on_download_update_panel_failed() -> void: 139 | download_dialog.hide() 140 | update_failed_dialog.dialog_text = "Updated Failed" 141 | update_failed_dialog.popup_centered() 142 | 143 | 144 | func _on_needs_reload_dialog_confirmed() -> void: 145 | EditorInterface.restart_editor(true) 146 | 147 | 148 | func _on_timer_timeout() -> void: 149 | if not needs_reload: 150 | check_for_update() 151 | 152 | #endregion 153 | 154 | 155 | #region Public Functions 156 | 157 | # Convert a version number to an actually comparable number 158 | func version_to_number(version: String) -> int: 159 | var regex = RegEx.new() 160 | regex.compile("[a-zA-Z]+") 161 | if regex.search(str(version)): return 0 162 | 163 | var bits = version.split(".") 164 | var version_bit: int 165 | var multiplier: int = 10000 166 | for i in bits.size(): 167 | version_bit += bits[i].to_int() * multiplier / (10 ** (i)) 168 | 169 | return version_bit 170 | 171 | 172 | func check_for_update() -> void: 173 | if ProjectSettings.get_setting(UPDATER_CONSTANTS.setting_updater_mode) == 0: return 174 | 175 | http_request.request(REMOTE_RELEASE_URL) 176 | 177 | #endregion 178 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/updater/update_button.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bwc42i46603qn 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/updater/updater_constants.gd: -------------------------------------------------------------------------------- 1 | extends RefCounted 2 | 3 | # Plugin Project Settings Sections 4 | const setting_phantom_camera: StringName = "phantom_camera/" 5 | const setting_updater_name: StringName = setting_phantom_camera + "updater/" 6 | 7 | # Updater Settings 8 | const setting_updater_mode: StringName = setting_updater_name + "updater_mode" 9 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/updater/updater_constants.gd.uid: -------------------------------------------------------------------------------- 1 | uid://c8qkbc38waor2 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/viewfinder/host_list.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends VBoxContainer 3 | 4 | #region Constants 5 | 6 | const _constants := preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd") 7 | const _host_list_item: PackedScene = preload("res://addons/phantom_camera/panel/viewfinder/host_list/host_list_item.tscn") 8 | 9 | #endregion 10 | 11 | signal pcam_host_removed(pcam_host: PhantomCameraHost) 12 | 13 | @onready var _host_list_button: Button = %HostListButton 14 | @onready var _host_list_scroll_container: ScrollContainer = %ScrollContainer 15 | @onready var _host_list_item_container: VBoxContainer = %HostListContainer 16 | 17 | var _host_list_open: bool = false 18 | 19 | var _bottom_offset_value: float 20 | 21 | var _pcam_host_list: Array[PhantomCameraHost] 22 | var _pcam_manager: Node 23 | 24 | var _viewfinder_panel: Control 25 | 26 | #region Private Functions 27 | 28 | func _ready() -> void: 29 | _host_list_button.pressed.connect(_host_list_button_pressed) 30 | if Engine.has_singleton(_constants.PCAM_MANAGER_NODE_NAME): 31 | _pcam_manager = Engine.get_singleton(_constants.PCAM_MANAGER_NODE_NAME) 32 | _pcam_manager.pcam_host_removed_from_scene.connect(_remove_pcam_host) 33 | 34 | if not get_parent() is Control: return # To prevent errors when opening the scene on its own 35 | _viewfinder_panel = get_parent() 36 | _viewfinder_panel.resized.connect(_set_offset_top) 37 | 38 | _host_list_item_container.resized.connect(_set_offset_top) 39 | 40 | 41 | func _set_offset_top() -> void: 42 | offset_top = _set_host_list_size() 43 | 44 | 45 | func _host_list_button_pressed() -> void: 46 | _host_list_open = !_host_list_open 47 | 48 | var tween: Tween = create_tween() 49 | var max_duration: float = 0.6 50 | 51 | # 300 being the minimum size of the viewfinder's height 52 | var duration: float = clampf( 53 | max_duration / (300 / _host_list_item_container.size.y), 54 | 0.3, 55 | max_duration) 56 | 57 | tween.tween_property(self, "offset_top", _set_host_list_size(), duration)\ 58 | .set_ease(Tween.EASE_OUT)\ 59 | .set_trans(Tween.TRANS_QUINT) 60 | 61 | 62 | func _set_host_list_size() -> float: 63 | if not _host_list_open: 64 | return clampf( 65 | _viewfinder_panel.size.y - \ 66 | _host_list_item_container.size.y - \ 67 | _host_list_button.size.y - 20, 68 | 0, 69 | INF 70 | ) 71 | else: 72 | return (_viewfinder_panel.size.y - _host_list_button.size.y / 2) 73 | 74 | 75 | func _remove_pcam_host(pcam_host: PhantomCameraHost) -> void: 76 | if _pcam_host_list.has(pcam_host): 77 | _pcam_host_list.erase(pcam_host) 78 | 79 | var freed_pcam_host: Control 80 | for host_list_item_instance in _host_list_item_container.get_children(): 81 | if not host_list_item_instance.pcam_host == pcam_host: continue 82 | freed_pcam_host = host_list_item_instance 83 | host_list_item_instance.queue_free() 84 | 85 | #endregion 86 | 87 | #region Public Functions 88 | 89 | func add_pcam_host(pcam_host: PhantomCameraHost, is_default: bool) -> void: 90 | if _pcam_host_list.has(pcam_host): return 91 | 92 | _pcam_host_list.append(pcam_host) 93 | 94 | var host_list_item_instance: PanelContainer = _host_list_item.instantiate() 95 | var switch_pcam_host_button: Button = host_list_item_instance.get_node("%SwitchPCamHost") 96 | if is_default: switch_pcam_host_button.button_pressed = true 97 | 98 | if not pcam_host.tree_exiting.is_connected(_remove_pcam_host): 99 | pcam_host.tree_exiting.connect(_remove_pcam_host.bind(pcam_host)) 100 | 101 | host_list_item_instance.pcam_host = pcam_host 102 | 103 | _host_list_item_container.add_child(host_list_item_instance) 104 | 105 | 106 | func clear_pcam_host_list() -> void: 107 | _pcam_host_list.clear() 108 | 109 | for host_list_item_instance in _host_list_item_container.get_children(): 110 | host_list_item_instance.queue_free() 111 | 112 | #endregion 113 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/viewfinder/host_list.gd.uid: -------------------------------------------------------------------------------- 1 | uid://c84cxry3t35ny 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/viewfinder/host_list_item.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends Control 3 | 4 | const button_group_resource: ButtonGroup = preload("res://addons/phantom_camera/panel/viewfinder/host_list/host_list_item_group.tres") 5 | const _constants = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd") 6 | 7 | @onready var select_pcam_host: Button = %SelectPCamHost 8 | @onready var switch_pcam_host: Button = %SwitchPCamHost 9 | 10 | var pcam_host: PhantomCameraHost: 11 | set(value): 12 | pcam_host = value 13 | if not is_instance_valid(value): return 14 | if not pcam_host.renamed.is_connected(_rename_pcam_host): 15 | pcam_host.renamed.connect(_rename_pcam_host) 16 | pcam_host.has_error.connect(_pcam_host_has_error) 17 | get: 18 | return pcam_host 19 | 20 | var _pcam_manager: Node 21 | 22 | #region Private fucntions 23 | 24 | func _ready() -> void: 25 | switch_pcam_host.button_group = button_group_resource 26 | select_pcam_host.pressed.connect(_select_pcam) 27 | switch_pcam_host.pressed.connect(_switch_pcam_host) 28 | 29 | if not is_instance_valid(pcam_host): return 30 | switch_pcam_host.text = pcam_host.name 31 | 32 | _pcam_host_has_error() 33 | 34 | 35 | func _pcam_host_has_error() -> void: 36 | if pcam_host.show_warning: 37 | %ErrorPCamHost.visible = true 38 | else: 39 | %ErrorPCamHost.visible = false 40 | 41 | 42 | func _rename_pcam_host() -> void: 43 | switch_pcam_host.text = pcam_host.name 44 | 45 | 46 | func _select_pcam() -> void: 47 | EditorInterface.get_selection().clear() 48 | EditorInterface.get_selection().add_node(pcam_host) 49 | 50 | 51 | func _switch_pcam_host() -> void: 52 | if not Engine.has_singleton(_constants.PCAM_MANAGER_NODE_NAME): return 53 | if not is_instance_valid(_pcam_manager): 54 | _pcam_manager = Engine.get_singleton(_constants.PCAM_MANAGER_NODE_NAME) 55 | 56 | _pcam_manager.viewfinder_pcam_host_switch.emit(pcam_host) 57 | 58 | #endregion 59 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/viewfinder/host_list_item.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bv24ubx8mutw7 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/panel/viewfinder/viewfinder.gd.uid: -------------------------------------------------------------------------------- 1 | uid://drmv3363t8amc 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCamera.cs.uid: -------------------------------------------------------------------------------- 1 | uid://d3wh0457i0i3 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCamera2D.cs.uid: -------------------------------------------------------------------------------- 1 | uid://c38e5qhsf3fk3 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCamera3D.cs.uid: -------------------------------------------------------------------------------- 1 | uid://bx3g7jxtwhi04 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCameraNoiseEmitter2D.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | namespace PhantomCamera.Noise; 4 | 5 | public class PhantomCameraNoiseEmitter2D(GodotObject node) 6 | { 7 | public Node2D Node2D = (Node2D)node; 8 | 9 | public PhantomCameraNoise2D Noise 10 | { 11 | get => new((Resource)Node2D.Call(MethodName.GetNoise)); 12 | set => Node2D.Call(MethodName.SetNoise, (GodotObject)value.Resource); 13 | } 14 | 15 | public bool Continuous 16 | { 17 | get => (bool)Node2D.Call(MethodName.GetContinuous); 18 | set => Node2D.Call(MethodName.SetContinuous, value); 19 | } 20 | 21 | public float GrowthTime 22 | { 23 | get => (float)Node2D.Call(MethodName.GetGrowthTime); 24 | set => Node2D.Call(MethodName.SetGrowthTime, value); 25 | } 26 | 27 | public float Duration 28 | { 29 | get => (float)Node2D.Call(MethodName.GetDuration); 30 | set => Node2D.Call(MethodName.SetDuration, value); 31 | } 32 | 33 | public float DecayTime 34 | { 35 | get => (float)Node2D.Call(MethodName.GetDecayTime); 36 | set => Node2D.Call(MethodName.SetDecayTime, value); 37 | } 38 | 39 | public int NoiseEmitterLayer 40 | { 41 | get => (int)Node2D.Call(MethodName.GetNoiseEmitterLayer); 42 | set => Node2D.Call(MethodName.SetNoiseEmitterLayer, value); 43 | } 44 | 45 | public void SetNoiseEmitterLayerValue(int layer, bool value) => 46 | Node2D.Call(MethodName.SetNoiseEmitterLayerValue, layer, value); 47 | 48 | public void Emit() => Node2D.Call(MethodName.Emit); 49 | 50 | public bool IsEmitting() => (bool)Node2D.Call(MethodName.IsEmitting); 51 | 52 | public void Stop() => Node2D.Call(MethodName.Stop); 53 | 54 | public void Toggle() => Node2D.Call(MethodName.Toggle); 55 | 56 | public static class MethodName 57 | { 58 | public const string GetNoise = "get_noise"; 59 | public const string SetNoise = "set_noise"; 60 | 61 | public const string GetContinuous = "get_continuous"; 62 | public const string SetContinuous = "set_continuous"; 63 | 64 | public const string GetGrowthTime = "get_growth_time"; 65 | public const string SetGrowthTime = "set_growth_time"; 66 | 67 | public const string GetDuration = "get_duration"; 68 | public const string SetDuration = "set_duration"; 69 | 70 | public const string GetDecayTime = "get_decay_time"; 71 | public const string SetDecayTime = "set_decay_time"; 72 | 73 | public const string GetNoiseEmitterLayer = "get_noise_emitter_layer"; 74 | public const string SetNoiseEmitterLayer = "set_noise_emitter_layer"; 75 | 76 | public const string SetNoiseEmitterLayerValue = "set_noise_emitter_layer_value"; 77 | 78 | public const string Emit = "emit"; 79 | public const string IsEmitting = "is_emitting"; 80 | public const string Stop = "stop"; 81 | public const string Toggle = "toggle"; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCameraNoiseEmitter2D.cs.uid: -------------------------------------------------------------------------------- 1 | uid://btom8l3wlkn2j 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCameraNoiseEmitter3D.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | namespace PhantomCamera.Noise; 4 | 5 | public class PhantomCameraNoiseEmitter3D(GodotObject node) 6 | { 7 | public Node3D Node3D = (Node3D)node; 8 | 9 | public PhantomCameraNoise3D Noise 10 | { 11 | get => new((Resource)Node3D.Call(MethodName.GetNoise)); 12 | set => Node3D.Call(MethodName.SetNoise, (GodotObject)value.Resource); 13 | } 14 | 15 | public bool Continuous 16 | { 17 | get => (bool)Node3D.Call(MethodName.GetContinuous); 18 | set => Node3D.Call(MethodName.SetContinuous, value); 19 | } 20 | 21 | public float GrowthTime 22 | { 23 | get => (float)Node3D.Call(MethodName.GetGrowthTime); 24 | set => Node3D.Call(MethodName.SetGrowthTime, value); 25 | } 26 | 27 | public float Duration 28 | { 29 | get => (float)Node3D.Call(MethodName.GetDuration); 30 | set => Node3D.Call(MethodName.SetDuration, value); 31 | } 32 | 33 | public float DecayTime 34 | { 35 | get => (float)Node3D.Call(MethodName.GetDecayTime); 36 | set => Node3D.Call(MethodName.SetDecayTime, value); 37 | } 38 | 39 | public int NoiseEmitterLayer 40 | { 41 | get => (int)Node3D.Call(MethodName.GetNoiseEmitterLayer); 42 | set => Node3D.Call(MethodName.SetNoiseEmitterLayer, value); 43 | } 44 | 45 | public void SetNoiseEmitterLayerValue(int layer, bool value) => 46 | Node3D.Call(MethodName.SetNoiseEmitterLayerValue, layer, value); 47 | 48 | public void Emit() => Node3D.Call(MethodName.Emit); 49 | 50 | public bool IsEmitting() => (bool)Node3D.Call(MethodName.IsEmitting); 51 | 52 | public void Stop() => Node3D.Call(MethodName.Stop); 53 | 54 | public void Toggle() => Node3D.Call(MethodName.Toggle); 55 | 56 | public static class MethodName 57 | { 58 | public const string GetNoise = "get_noise"; 59 | public const string SetNoise = "set_noise"; 60 | 61 | public const string GetContinuous = "get_continuous"; 62 | public const string SetContinuous = "set_continuous"; 63 | 64 | public const string GetGrowthTime = "get_growth_time"; 65 | public const string SetGrowthTime = "set_growth_time"; 66 | 67 | public const string GetDuration = "get_duration"; 68 | public const string SetDuration = "set_duration"; 69 | 70 | public const string GetDecayTime = "get_decay_time"; 71 | public const string SetDecayTime = "set_decay_time"; 72 | 73 | public const string GetNoiseEmitterLayer = "get_noise_emitter_layer"; 74 | public const string SetNoiseEmitterLayer = "set_noise_emitter_layer"; 75 | 76 | public const string SetNoiseEmitterLayerValue = "set_noise_emitter_layer_value"; 77 | 78 | public const string Emit = "emit"; 79 | public const string IsEmitting = "is_emitting"; 80 | public const string Stop = "stop"; 81 | public const string Toggle = "toggle"; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/PhantomCameraNoiseEmitter3D.cs.uid: -------------------------------------------------------------------------------- 1 | uid://buvda14filkjx 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bhexx6mj1xv3q 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/phantom_camera_3d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://csjccrhj5wnx7 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | extends RefCounted 3 | 4 | #region Constants 5 | 6 | #const PhantomCameraHost: Script = preload("res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd") 7 | 8 | const CAMERA_2D_NODE_NAME: StringName = "Camera2D" 9 | const CAMERA_3D_NODE_NAME: StringName = "Camera3D" 10 | const PCAM_HOST_NODE_NAME: StringName = "PhantomCameraHost" 11 | const PCAM_MANAGER_NODE_NAME: String = "PhantomCameraManager" # TODO - Convert to StringName once https://github.com/godotengine/godot/pull/72702 is merged 12 | const PCAM_2D_NODE_NAME: StringName = "PhantomCamera2D" 13 | const PCAM_3D_NODE_NAME: StringName = "PhantomCamera3D" 14 | const PCAM_HOST: StringName = "phantom_camera_host" 15 | 16 | const COLOR_2D: Color = Color("8DA5F3") 17 | const COLOR_3D: Color = Color("FC7F7F") 18 | const COLOR_PCAM: Color = Color("3AB99A") 19 | const COLOR_PCAM_33: Color = Color("3ab99a33") 20 | const PCAM_HOST_COLOR: Color = Color("E0E0E0") 21 | 22 | #endregion 23 | 24 | #region Group Names 25 | 26 | const PCAM_GROUP_NAME: StringName = "phantom_camera_group" 27 | const PCAM_HOST_GROUP_NAME: StringName = "phantom_camera_host_group" 28 | 29 | #endregion 30 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dn74j5b5hdxu 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/phantom_camera_noise_emitter_2d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bhd4nuiu23e7l 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera/phantom_camera_noise_emitter_3d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://ccmiitq0sdh7j 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera_host/PhantomCameraHost.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | #nullable enable 4 | 5 | namespace PhantomCamera; 6 | 7 | // public enum InterpolationMode 8 | // { 9 | // Auto, 10 | // Idle, 11 | // Physics 12 | // } 13 | 14 | public static class PhantomCameraHostExtensions 15 | { 16 | public static PhantomCameraHost AsPhantomCameraHost(this Node node) 17 | { 18 | return new PhantomCameraHost(node); 19 | } 20 | } 21 | 22 | public class PhantomCameraHost() 23 | { 24 | public Node Node { get; } = null!; 25 | 26 | public PhantomCameraHost(Node node) : this() 27 | { 28 | Node = node; 29 | 30 | _callablePCamBecameActive = Callable.From(pCam => PCamBecameActive?.Invoke(pCam)); 31 | _callablePCamBecameInactive = Callable.From(pCam => PCamBecameInactive?.Invoke(pCam)); 32 | 33 | Node.Connect(SignalName.PCamBecameActive, _callablePCamBecameActive); 34 | Node.Connect(SignalName.PCamBecameInactive, _callablePCamBecameInactive); 35 | } 36 | 37 | ~PhantomCameraHost() 38 | { 39 | Node.Disconnect(SignalName.PCamBecameActive, _callablePCamBecameActive); 40 | Node.Disconnect(SignalName.PCamBecameInactive, _callablePCamBecameInactive); 41 | } 42 | 43 | public delegate void PCamBecameActiveEventHandler(Node pCam); 44 | public delegate void PCamBecameInactiveEventHandler(Node pCam); 45 | 46 | public event PCamBecameActiveEventHandler? PCamBecameActive; 47 | public event PCamBecameInactiveEventHandler? PCamBecameInactive; 48 | 49 | 50 | private readonly Callable _callablePCamBecameActive; 51 | private readonly Callable _callablePCamBecameInactive; 52 | // For when Godot becomes the minimum version 53 | // public InterpolationMode InterpolationMode 54 | // { 55 | // get => (InterpolationMode)(int)Node.Call(MethodName.GetInterpolationMode); 56 | // set => Node.Call(MethodName.SetInterpolationMode, (int)value); 57 | // } 58 | 59 | public int HostLayers 60 | { 61 | get => (int)Node.Call(PhantomCamera.MethodName.GetHostLayers); 62 | set => Node.Call(PhantomCamera.MethodName.SetHostLayers, value); 63 | } 64 | 65 | public void SetHostLayersValue(int layer, bool value) => Node.Call(MethodName.SetHostLayersValue, layer, value); 66 | 67 | public Camera2D? Camera2D => (Camera2D?)Node.Get(PropertyName.Camera2D); 68 | 69 | public Camera3D? Camera3D => (Camera3D?)Node.Get(PropertyName.Camera3D); 70 | 71 | public int InterpolationMode 72 | { 73 | get => (int)Node.Call(MethodName.GetInterpolationMode); 74 | set => Node.Call(MethodName.SetInterpolationMode, value); 75 | } 76 | 77 | public bool TriggerPhantomCameraTween => (bool)Node.Call(MethodName.GetTriggerPhantomCameraTween); 78 | 79 | public ActivePhantomCameraQueryResult? GetActivePhantomCamera() 80 | { 81 | var result = Node.Call(MethodName.GetActivePhantomCamera); 82 | return result.VariantType == Variant.Type.Nil ? null : new ActivePhantomCameraQueryResult(result.AsGodotObject()); 83 | } 84 | 85 | public static class PropertyName 86 | { 87 | public const string Camera2D = "camera_2d"; 88 | public const string Camera3D = "camera_3d"; 89 | } 90 | 91 | public static class MethodName 92 | { 93 | public const string GetActivePhantomCamera = "get_active_pcam"; 94 | public const string GetTriggerPhantomCameraTween = "get_trigger_pcam_tween"; 95 | 96 | public const string GetInterpolationMode = "get_interpolation_mode"; 97 | public const string SetInterpolationMode = "set_interpolation_mode"; 98 | 99 | public const string SetHostLayersValue = "set_host_layers_value"; 100 | } 101 | 102 | public static class SignalName 103 | { 104 | public const string PCamBecameActive = "pcam_became_active"; 105 | public const string PCamBecameInactive = "pcam_became_inactive"; 106 | } 107 | } 108 | 109 | public class ActivePhantomCameraQueryResult(GodotObject godotObject) 110 | { 111 | public bool Is2D => godotObject.IsClass("Node2D") || ((Node)godotObject).Name.ToString().Contains("PhantomCamera2D") 112 | || ((Node)godotObject).Name.ToString().Contains("PCam2D") 113 | || ((Node)godotObject).Name.ToString().Contains("2D"); 114 | 115 | public bool Is3D => godotObject.IsClass("Node3D") || ((Node)godotObject).Name.ToString().Contains("PhantomCamera3D") 116 | || ((Node)godotObject).Name.ToString().Contains("PCam3D") 117 | || ((Node)godotObject).Name.ToString().Contains("3D"); 118 | 119 | public PhantomCamera2D? AsPhantomCamera2D() 120 | { 121 | return Is2D ? new PhantomCamera2D(godotObject) : null; 122 | } 123 | 124 | public PhantomCamera3D? AsPhantomCamera3D() 125 | { 126 | return Is3D ? new PhantomCamera3D(godotObject) : null; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera_host/PhantomCameraHost.cs.uid: -------------------------------------------------------------------------------- 1 | uid://cr8brwrls2nn3 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bd046eokvcnu2 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/Camera3DResource.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | namespace PhantomCamera; 4 | 5 | public enum KeepAspect 6 | { 7 | KeepWidth, 8 | KeepHeight 9 | } 10 | 11 | public enum ProjectionType 12 | { 13 | Perspective, 14 | Orthogonal, 15 | Frustum 16 | } 17 | 18 | public class Camera3DResource(Resource resource) 19 | { 20 | public readonly Resource Resource = resource; 21 | 22 | public KeepAspect KeepAspect 23 | { 24 | get => (KeepAspect)(int)Resource.Call(MethodName.GetKeepAspect); 25 | set => Resource.Call(MethodName.SetKeepAspect, (int)value); 26 | } 27 | 28 | public int CullMask 29 | { 30 | get => (int)Resource.Call(MethodName.GetCullMask); 31 | set => Resource.Call(MethodName.SetCullMask, value); 32 | } 33 | 34 | public void SetCullMaskValue(int layer, bool value) => Resource.Call(MethodName.SetCullMaskValue, layer, value); 35 | 36 | public float HOffset 37 | { 38 | get => (float)Resource.Call(MethodName.GetHOffset); 39 | set => Resource.Call(MethodName.SetHOffset, value); 40 | } 41 | 42 | public float VOffset 43 | { 44 | get => (float)Resource.Call(MethodName.GetVOffset); 45 | set => Resource.Call(MethodName.SetVOffset, value); 46 | } 47 | 48 | public ProjectionType Projection 49 | { 50 | get => (ProjectionType)(int)Resource.Call(MethodName.GetProjection); 51 | set => Resource.Call(MethodName.SetProjection, (int)value); 52 | } 53 | 54 | public float Fov 55 | { 56 | get => (float)Resource.Call(MethodName.GetFov); 57 | set => Resource.Call(MethodName.SetFov, Mathf.Clamp(value, 1, 179)); 58 | } 59 | 60 | public float Size 61 | { 62 | get => (float)Resource.Call(MethodName.GetSize); 63 | set => Resource.Call(MethodName.SetSize, Mathf.Clamp(value, 0.001f, float.PositiveInfinity)); 64 | } 65 | 66 | public Vector2 FrustumOffset 67 | { 68 | get => (Vector2)Resource.Call(MethodName.GetFrustumOffset); 69 | set => Resource.Call(MethodName.SetFrustumOffset, value); 70 | } 71 | 72 | public float Near 73 | { 74 | get => (float)Resource.Call(MethodName.GetNear); 75 | set => Resource.Call(MethodName.SetNear, Mathf.Clamp(value, 0.001f, float.PositiveInfinity)); 76 | } 77 | 78 | public float Far 79 | { 80 | get => (float)Resource.Call(MethodName.GetFar); 81 | set => Resource.Call(MethodName.SetFar, Mathf.Clamp(value, 0.01f, float.PositiveInfinity)); 82 | } 83 | 84 | public static class MethodName 85 | { 86 | public const string GetKeepAspect = "get_keep_aspect"; 87 | public const string SetKeepAspect = "set_keep_aspect"; 88 | 89 | public const string GetCullMask = "get_cull_mask"; 90 | public const string SetCullMask = "set_cull_mask"; 91 | public const string SetCullMaskValue = "set_cull_mask_value"; 92 | 93 | public const string GetHOffset = "get_h_offset"; 94 | public const string SetHOffset = "set_h_offset"; 95 | 96 | public const string GetVOffset = "get_v_offset"; 97 | public const string SetVOffset = "set_v_offset"; 98 | 99 | public const string GetProjection = "get_projection"; 100 | public const string SetProjection = "set_projection"; 101 | 102 | public const string GetFov = "get_fov"; 103 | public const string SetFov = "set_fov"; 104 | 105 | public const string GetSize = "get_size"; 106 | public const string SetSize = "set_size"; 107 | 108 | public const string GetFrustumOffset = "get_frustum_offset"; 109 | public const string SetFrustumOffset = "set_frustum_offset"; 110 | 111 | public const string GetNear = "get_near"; 112 | public const string SetNear = "set_near"; 113 | 114 | public const string GetFar = "get_far"; 115 | public const string SetFar = "set_far"; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/Camera3DResource.cs.uid: -------------------------------------------------------------------------------- 1 | uid://jedyxlihuwbj 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/PhantomCameraNoise2D.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | namespace PhantomCamera.Noise; 4 | 5 | public class PhantomCameraNoise2D(Resource resource) 6 | { 7 | public readonly Resource Resource = resource; 8 | 9 | public float Amplitude 10 | { 11 | get => (float)Resource.Call(MethodName.GetAmplitude); 12 | set => Resource.Call(MethodName.SetAmplitude, value); 13 | } 14 | 15 | public float Frequency 16 | { 17 | get => (float)Resource.Call(MethodName.GetFrequency); 18 | set => Resource.Call(MethodName.SetFrequency, value); 19 | } 20 | 21 | public bool RandomizeNoiseSeed 22 | { 23 | get => (bool)Resource.Call(MethodName.GetRandomizeNoiseSeed); 24 | set => Resource.Call(MethodName.SetRandomizeNoiseSeed, value); 25 | } 26 | 27 | public int NoiseSeed 28 | { 29 | get => (int)Resource.Call(MethodName.GetNoiseSeed); 30 | set => Resource.Call(MethodName.SetNoiseSeed, value); 31 | } 32 | 33 | public bool RotationalNoise 34 | { 35 | get => (bool)Resource.Call(MethodName.GetRotationalNoise); 36 | set => Resource.Call(MethodName.SetRotationalNoise, value); 37 | } 38 | 39 | public bool PositionalNoise 40 | { 41 | get => (bool)Resource.Call(MethodName.GetPositionalNoise); 42 | set => Resource.Call(MethodName.SetPositionalNoise, value); 43 | } 44 | 45 | public float RotationalMultiplier 46 | { 47 | get => (float)Resource.Call(MethodName.GetRotationalMultiplier); 48 | set => Resource.Call(MethodName.SetRotationalMultiplier, value); 49 | } 50 | 51 | public float PositionalMultiplierX 52 | { 53 | get => (float)Resource.Call(MethodName.GetPositionalMultiplierX); 54 | set => Resource.Call(MethodName.SetPositionalMultiplierX, value); 55 | } 56 | 57 | public float PositionalMultiplierY 58 | { 59 | get => (float)Resource.Call(MethodName.GetPositionalMultiplierY); 60 | set => Resource.Call(MethodName.SetPositionalMultiplierY, value); 61 | } 62 | 63 | public static class MethodName 64 | { 65 | public const string GetAmplitude = "get_amplitude"; 66 | public const string SetAmplitude = "set_amplitude"; 67 | 68 | public const string GetFrequency = "get_frequency"; 69 | public const string SetFrequency = "set_frequency"; 70 | 71 | public const string GetRandomizeNoiseSeed = "get_randomize_noise_seed"; 72 | public const string SetRandomizeNoiseSeed = "set_randomize_noise_seed"; 73 | 74 | public const string GetNoiseSeed = "get_noise_seed"; 75 | public const string SetNoiseSeed = "set_noise_seed"; 76 | 77 | public const string GetRotationalNoise = "get_rotational_noise"; 78 | public const string SetRotationalNoise = "set_rotational_noise"; 79 | 80 | public const string GetPositionalNoise = "get_positional_noise"; 81 | public const string SetPositionalNoise = "set_positional_noise"; 82 | 83 | public const string GetRotationalMultiplier = "get_rotational_multiplier"; 84 | public const string SetRotationalMultiplier = "set_rotational_multiplier"; 85 | 86 | public const string GetPositionalMultiplierX = "get_positional_multiplier_x"; 87 | public const string SetPositionalMultiplierX = "set_positional_multiplier_x"; 88 | 89 | public const string GetPositionalMultiplierY = "get_positional_multiplier_y"; 90 | public const string SetPositionalMultiplierY = "set_positional_multiplier_y"; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/PhantomCameraNoise2D.cs.uid: -------------------------------------------------------------------------------- 1 | uid://capjdoxs6gs6r 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/PhantomCameraNoise3D.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | namespace PhantomCamera.Noise; 4 | 5 | public class PhantomCameraNoise3D(Resource resource) 6 | { 7 | public readonly Resource Resource = resource; 8 | 9 | public float Amplitude 10 | { 11 | get => (float)Resource.Call(MethodName.GetAmplitude); 12 | set => Resource.Call(MethodName.SetAmplitude, value); 13 | } 14 | 15 | public float Frequency 16 | { 17 | get => (float)Resource.Call(MethodName.GetFrequency); 18 | set => Resource.Call(MethodName.SetFrequency, value); 19 | } 20 | 21 | public bool RandomizeNoiseSeed 22 | { 23 | get => (bool)Resource.Call(MethodName.GetRandomizeNoiseSeed); 24 | set => Resource.Call(MethodName.SetRandomizeNoiseSeed, value); 25 | } 26 | 27 | public int NoiseSeed 28 | { 29 | get => (int)Resource.Call(MethodName.GetNoiseSeed); 30 | set => Resource.Call(MethodName.SetNoiseSeed, value); 31 | } 32 | 33 | public bool RotationalNoise 34 | { 35 | get => (bool)Resource.Call(MethodName.GetRotationalNoise); 36 | set => Resource.Call(MethodName.SetRotationalNoise, value); 37 | } 38 | 39 | public bool PositionalNoise 40 | { 41 | get => (bool)Resource.Call(MethodName.GetPositionalNoise); 42 | set => Resource.Call(MethodName.SetPositionalNoise, value); 43 | } 44 | 45 | public float RotationalMultiplierX 46 | { 47 | get => (float)Resource.Call(MethodName.GetRotationalMultiplierX); 48 | set => Resource.Call(MethodName.SetRotationalMultiplierX, value); 49 | } 50 | 51 | public float RotationalMultiplierY 52 | { 53 | get => (float)Resource.Call(MethodName.GetRotationalMultiplierY); 54 | set => Resource.Call(MethodName.SetRotationalMultiplierY, value); 55 | } 56 | 57 | public float RotationalMultiplierZ 58 | { 59 | get => (float)Resource.Call(MethodName.GetRotationalMultiplierZ); 60 | set => Resource.Call(MethodName.SetRotationalMultiplierZ, value); 61 | } 62 | 63 | public float PositionalMultiplierX 64 | { 65 | get => (float)Resource.Call(MethodName.GetPositionalMultiplierX); 66 | set => Resource.Call(MethodName.SetPositionalMultiplierX, value); 67 | } 68 | 69 | public float PositionalMultiplierY 70 | { 71 | get => (float)Resource.Call(MethodName.GetPositionalMultiplierY); 72 | set => Resource.Call(MethodName.SetPositionalMultiplierY, value); 73 | } 74 | 75 | public float PositionalMultiplierZ 76 | { 77 | get => (float)Resource.Call(MethodName.GetPositionalMultiplierZ); 78 | set => Resource.Call(MethodName.SetPositionalMultiplierZ, value); 79 | } 80 | 81 | public static class MethodName 82 | { 83 | public const string GetAmplitude = "get_amplitude"; 84 | public const string SetAmplitude = "set_amplitude"; 85 | 86 | public const string GetFrequency = "get_frequency"; 87 | public const string SetFrequency = "set_frequency"; 88 | 89 | public const string GetRandomizeNoiseSeed = "get_randomize_noise_seed"; 90 | public const string SetRandomizeNoiseSeed = "set_randomize_noise_seed"; 91 | 92 | public const string GetNoiseSeed = "get_noise_seed"; 93 | public const string SetNoiseSeed = "set_noise_seed"; 94 | 95 | public const string GetRotationalNoise = "get_rotational_noise"; 96 | public const string SetRotationalNoise = "set_rotational_noise"; 97 | 98 | public const string GetPositionalNoise = "get_positional_noise"; 99 | public const string SetPositionalNoise = "set_positional_noise"; 100 | 101 | public const string GetRotationalMultiplierX = "get_rotational_multiplier_x"; 102 | public const string SetRotationalMultiplierX = "set_rotational_multiplier_x"; 103 | 104 | public const string GetRotationalMultiplierY = "get_rotational_multiplier_y"; 105 | public const string SetRotationalMultiplierY = "set_rotational_multiplier_y"; 106 | 107 | public const string GetRotationalMultiplierZ = "get_rotational_multiplier_z"; 108 | public const string SetRotationalMultiplierZ = "set_rotational_multiplier_z"; 109 | 110 | public const string GetPositionalMultiplierX = "get_positional_multiplier_x"; 111 | public const string SetPositionalMultiplierX = "set_positional_multiplier_x"; 112 | 113 | public const string GetPositionalMultiplierY = "get_positional_multiplier_y"; 114 | public const string SetPositionalMultiplierY = "set_positional_multiplier_y"; 115 | 116 | public const string GetPositionalMultiplierZ = "get_positional_multiplier_z"; 117 | public const string SetPositionalMultiplierZ = "set_positional_multiplier_z"; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/PhantomCameraNoise3D.cs.uid: -------------------------------------------------------------------------------- 1 | uid://chk7643ynhe4f 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/PhantomCameraTween.cs: -------------------------------------------------------------------------------- 1 | using Godot; 2 | 3 | namespace PhantomCamera; 4 | 5 | public enum TransitionType 6 | { 7 | Linear, 8 | Sine, 9 | Quint, 10 | Quart, 11 | Quad, 12 | Expo, 13 | Elastic, 14 | Cubic, 15 | Circ, 16 | Bounce, 17 | Back 18 | } 19 | 20 | public enum EaseType 21 | { 22 | EaseIn, 23 | EaseOut, 24 | EaseInOut, 25 | EaseOutIn 26 | } 27 | 28 | public static class PhantomCameraTweenExtensions 29 | { 30 | public static PhantomCameraTween AsPhantomCameraTween(this Resource resource) 31 | { 32 | return new PhantomCameraTween(resource); 33 | } 34 | } 35 | 36 | public class PhantomCameraTween(Resource tweenResource) 37 | { 38 | public Resource Resource { get; } = tweenResource; 39 | 40 | public float Duration 41 | { 42 | get => (float)Resource.Get(PropertyName.Duration); 43 | set => Resource.Set(PropertyName.Duration, value); 44 | } 45 | 46 | public TransitionType Transition 47 | { 48 | get => (TransitionType)(int)Resource.Get(PropertyName.Transition); 49 | set => Resource.Set(PropertyName.Transition, (int)value); 50 | } 51 | 52 | public EaseType Ease 53 | { 54 | get => (EaseType)(int)Resource.Get(PropertyName.Ease); 55 | set => Resource.Set(PropertyName.Ease, (int)value); 56 | } 57 | 58 | public static class PropertyName 59 | { 60 | public const string Duration = "duration"; 61 | public const string Transition = "transition"; 62 | public const string Ease = "ease"; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/PhantomCameraTween.cs.uid: -------------------------------------------------------------------------------- 1 | uid://ybr5c2s0tfvx 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/camera_3d_resource.gd: -------------------------------------------------------------------------------- 1 | @tool 2 | @icon("res://addons/phantom_camera/icons/phantom_camera_camera_3d_resource.svg") 3 | class_name Camera3DResource 4 | extends Resource 5 | 6 | ## Resource for [PhantomCamera3D] to override various [Camera3D] properties. 7 | ## 8 | ## The overrides defined here will be applied to the [Camera3D] upon the 9 | ## [PhantomCamera3D] becoming active. 10 | 11 | enum KeepAspect { 12 | KEEP_WIDTH = 0, ## Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best option for projects running in portrait mode, as taller aspect ratios will benefit from a wider vertical FOV. 13 | KEEP_HEIGHT = 1, ## Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV. 14 | } 15 | 16 | enum ProjectionType { 17 | PERSPECTIVE = 0, ## Perspective projection. Objects on the screen becomes smaller when they are far away. 18 | ORTHOGONAL = 1, ## Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. 19 | FRUSTUM = 2, ## Frustum projection. This mode allows adjusting frustum_offset to create "tilted frustum" effects. 20 | } 21 | 22 | ## Overrides [member Camera3D.keep_aspect]. 23 | @export var keep_aspect: KeepAspect = KeepAspect.KEEP_HEIGHT: 24 | set(value): 25 | keep_aspect = value 26 | emit_changed() 27 | get: 28 | return keep_aspect 29 | 30 | ## Overrides [member Camera3D.cull_mask]. 31 | @export_flags_3d_render var cull_mask: int = 1048575: 32 | set(value): 33 | cull_mask = value 34 | emit_changed() 35 | get: 36 | return cull_mask 37 | 38 | ## Overrides [member Camera3D.h_offset]. 39 | @export_range(0, 1, 0.001, "or_greater", "or_less", "hide_slider", "suffix:m") var h_offset: float = 0: 40 | set(value): 41 | h_offset = value 42 | emit_changed() 43 | get: 44 | return h_offset 45 | 46 | ## Overrides [member Camera3D.v_offset]. 47 | @export_range(0, 1, 0.001, "or_greater", "or_less", "hide_slider", "suffix:m") var v_offset: float = 0: 48 | set(value): 49 | v_offset = value 50 | emit_changed() 51 | 52 | ## Overrides [member Camera3D.projection]. 53 | @export var projection: ProjectionType = ProjectionType.PERSPECTIVE: 54 | set(value): 55 | projection = value 56 | notify_property_list_changed() 57 | emit_changed() 58 | get: 59 | return projection 60 | 61 | ## Overrides [member Camera3D.fov]. 62 | @export_range(1, 179, 0.1, "degrees") var fov: float = 75: 63 | set(value): 64 | fov = value 65 | emit_changed() 66 | get: 67 | return fov 68 | 69 | ## Overrides [member Camera3D.size]. 70 | @export_range(0.001, 100, 0.001, "suffix:m", "or_greater") var size: float = 1: 71 | set(value): 72 | size = value 73 | emit_changed() 74 | get: 75 | return size 76 | 77 | ## Overrides [member Camera3d.frustum_offset]. 78 | @export var frustum_offset: Vector2 = Vector2.ZERO: 79 | set(value): 80 | frustum_offset = value 81 | emit_changed() 82 | get: 83 | return frustum_offset 84 | 85 | ## Overrides [member Camera3D.near]. 86 | @export_range(0.001, 10, 0.001, "suffix:m", "or_greater") var near: float = 0.05: 87 | set(value): 88 | near = value 89 | emit_changed() 90 | get: 91 | return near 92 | 93 | ## Overrides [member Camera3D.far]. 94 | @export_range(0.01, 4000, 0.001, "suffix:m","or_greater") var far: float = 4000: 95 | set(value): 96 | far = value 97 | emit_changed() 98 | get: 99 | return far 100 | 101 | 102 | func _validate_property(property: Dictionary) -> void: 103 | if property.name == "fov" and not projection == ProjectionType.PERSPECTIVE: 104 | property.usage = PROPERTY_USAGE_NO_EDITOR 105 | 106 | if property.name == "size" and projection == ProjectionType.PERSPECTIVE: 107 | property.usage = PROPERTY_USAGE_NO_EDITOR 108 | 109 | if property.name == "frustum_offset" and not projection == ProjectionType.FRUSTUM: 110 | property.usage = PROPERTY_USAGE_NO_EDITOR 111 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/camera_3d_resource.gd.uid: -------------------------------------------------------------------------------- 1 | uid://bc2tn187qiatpcheck 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/phantom_camera_noise_2d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://dimvdouy8g0sv 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/phantom_camera_noise_3d.gd.uid: -------------------------------------------------------------------------------- 1 | uid://cuffvge5ad4aa 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/tween_resource.gd: -------------------------------------------------------------------------------- 1 | @icon("res://addons/phantom_camera/icons/phantom_camera_tween.svg") 2 | class_name PhantomCameraTween 3 | extends Resource 4 | 5 | ## Tweening resource for [PhantomCamera2D] and [PhantomCamera3D]. 6 | ## 7 | ## Defines how [param PhantomCameras] transition between one another. 8 | ## Changing the tween values for a given [param PhantomCamera] determines how 9 | ## transitioning to that instance will look like. 10 | 11 | enum TransitionType { 12 | LINEAR = 0, ## The animation is interpolated linearly. 13 | SINE = 1, ## The animation is interpolated using a sine function. 14 | QUINT = 2, ## The animation is interpolated with a quintic (to the power of 5) function. 15 | QUART = 3, ## The animation is interpolated with a quartic (to the power of 4) function. 16 | QUAD = 4, ## The animation is interpolated with a quadratic (to the power of 2) function. 17 | EXPO = 5, ## The animation is interpolated with an exponential (to the power of x) function. 18 | ELASTIC = 6, ## The animation is interpolated with elasticity, wiggling around the edges. 19 | CUBIC = 7, ## The animation is interpolated with a cubic (to the power of 3) function. 20 | CIRC = 8, ## The animation is interpolated with a function using square roots. 21 | BOUNCE = 9, ## The animation is interpolated by bouncing at the end. 22 | BACK = 10, ## The animation is interpolated backing out at ends. 23 | # CUSTOM = 11, 24 | # NONE = 12, 25 | } 26 | 27 | enum EaseType { 28 | EASE_IN = 0, ## The interpolation starts slowly and speeds up towards the end. 29 | EASE_OUT = 1, ## The interpolation starts quickly and slows down towards the end. 30 | EASE_IN_OUT = 2, ## A combination of EASE_IN and EASE_OUT. The interpolation is slowest at both ends. 31 | EASE_OUT_IN = 3, ## A combination of EASE_IN and EASE_OUT. The interpolation is fastest at both ends. 32 | } 33 | 34 | ## The time it takes to tween to this PhantomCamera in [param seconds]. 35 | @export var duration: float = 1.0 36 | 37 | ## The transition bezier type for the tween. The options are defined in the [enum TransitionType]. 38 | @export var transition: TransitionType = TransitionType.LINEAR 39 | 40 | ## The ease type for the tween. The options are defined in the [enum EaseType]. 41 | @export var ease: EaseType = EaseType.EASE_IN_OUT 42 | -------------------------------------------------------------------------------- /addons/phantom_camera/scripts/resources/tween_resource.gd.uid: -------------------------------------------------------------------------------- 1 | uid://8umksf8e80fw 2 | -------------------------------------------------------------------------------- /addons/phantom_camera/themes/button_focus.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="StyleBoxFlat" format=3 uid="uid://p058hmj3uut0"] 2 | 3 | [resource] 4 | content_margin_left = 8.0 5 | content_margin_top = 4.0 6 | content_margin_right = 8.0 7 | content_margin_bottom = 4.0 8 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 9 | border_width_left = 2 10 | border_width_top = 2 11 | border_width_right = 2 12 | border_width_bottom = 2 13 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 14 | corner_radius_top_left = 8 15 | corner_radius_top_right = 8 16 | corner_radius_bottom_right = 8 17 | corner_radius_bottom_left = 8 18 | -------------------------------------------------------------------------------- /addons/phantom_camera/themes/button_hover.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="StyleBoxFlat" format=3 uid="uid://5weqvkjsfso3"] 2 | 3 | [resource] 4 | content_margin_left = 8.0 5 | content_margin_top = 4.0 6 | content_margin_right = 8.0 7 | content_margin_bottom = 4.0 8 | bg_color = Color(0.960784, 0.960784, 0.960784, 1) 9 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 10 | corner_radius_top_left = 8 11 | corner_radius_top_right = 8 12 | corner_radius_bottom_right = 8 13 | corner_radius_bottom_left = 8 14 | -------------------------------------------------------------------------------- /addons/phantom_camera/themes/button_normal.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="StyleBoxFlat" format=3 uid="uid://bclbwo3xrdat0"] 2 | 3 | [resource] 4 | content_margin_left = 8.0 5 | content_margin_top = 4.0 6 | content_margin_right = 8.0 7 | content_margin_bottom = 4.0 8 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 9 | border_width_left = 2 10 | border_width_top = 2 11 | border_width_right = 2 12 | border_width_bottom = 2 13 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 14 | corner_radius_top_left = 8 15 | corner_radius_top_right = 8 16 | corner_radius_bottom_right = 8 17 | corner_radius_bottom_left = 8 18 | -------------------------------------------------------------------------------- /addons/phantom_camera/themes/theme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=12 format=3 uid="uid://bhppejri5dbsf"] 2 | 3 | [ext_resource type="FontFile" uid="uid://dve7mgsjik4dg" path="res://addons/phantom_camera/fonts/Nunito-Regular.ttf" id="1_5rtjh"] 4 | [ext_resource type="StyleBox" uid="uid://5weqvkjsfso3" path="res://addons/phantom_camera/themes/button_hover.tres" id="2_du6h5"] 5 | [ext_resource type="StyleBox" uid="uid://bclbwo3xrdat0" path="res://addons/phantom_camera/themes/button_normal.tres" id="3_a8j1f"] 6 | 7 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ek0y3"] 8 | content_margin_left = 8.0 9 | content_margin_top = 4.0 10 | content_margin_right = 8.0 11 | content_margin_bottom = 4.0 12 | bg_color = Color(0.227451, 0.72549, 0.603922, 1) 13 | corner_radius_top_left = 8 14 | corner_radius_top_right = 8 15 | corner_radius_bottom_right = 8 16 | corner_radius_bottom_left = 8 17 | 18 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rjkuq"] 19 | content_margin_left = 8.0 20 | content_margin_top = 4.0 21 | content_margin_right = 8.0 22 | content_margin_bottom = 4.0 23 | bg_color = Color(0.227451, 0.72549, 0.603922, 1) 24 | corner_radius_top_left = 8 25 | corner_radius_top_right = 8 26 | corner_radius_bottom_right = 8 27 | corner_radius_bottom_left = 8 28 | 29 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_x7u0w"] 30 | content_margin_top = 2.0 31 | content_margin_right = 8.0 32 | bg_color = Color(0.0784314, 0.109804, 0.129412, 1) 33 | border_width_top = 2 34 | border_width_right = 2 35 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 36 | corner_radius_top_right = 10 37 | 38 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dln2q"] 39 | content_margin_top = 8.0 40 | content_margin_bottom = 8.0 41 | draw_center = false 42 | 43 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wk7ot"] 44 | bg_color = Color(0.227451, 0.72549, 0.603922, 1) 45 | border_color = Color(0.227451, 0.72549, 0.603922, 1) 46 | corner_radius_top_left = 8 47 | corner_radius_top_right = 8 48 | corner_radius_bottom_right = 8 49 | corner_radius_bottom_left = 8 50 | 51 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jidrt"] 52 | bg_color = Color(0.960784, 0.960784, 0.960784, 1) 53 | border_width_left = 2 54 | border_width_top = 2 55 | border_width_right = 2 56 | border_width_bottom = 2 57 | corner_radius_top_left = 8 58 | corner_radius_top_right = 8 59 | corner_radius_bottom_right = 8 60 | corner_radius_bottom_left = 8 61 | 62 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o2xwc"] 63 | bg_color = Color(0.960784, 0.960784, 0.960784, 1) 64 | border_width_left = 2 65 | border_width_top = 2 66 | border_width_right = 2 67 | border_width_bottom = 2 68 | corner_radius_top_left = 8 69 | corner_radius_top_right = 8 70 | corner_radius_bottom_right = 8 71 | corner_radius_bottom_left = 8 72 | 73 | [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ul127"] 74 | draw_center = false 75 | border_width_left = 4 76 | border_width_right = 4 77 | border_color = Color(0.8, 0.8, 0.8, 0) 78 | 79 | [resource] 80 | default_font = ExtResource("1_5rtjh") 81 | Button/colors/font_color = Color(0.227451, 0.72549, 0.603922, 1) 82 | Button/colors/font_focus_color = Color(0.0784314, 0.109804, 0.129412, 1) 83 | Button/colors/font_hover_color = Color(0.0784314, 0.109804, 0.129412, 1) 84 | Button/colors/font_hover_pressed_color = Color(0.0784314, 0.109804, 0.129412, 1) 85 | Button/colors/font_pressed_color = Color(0.0784314, 0.109804, 0.129412, 1) 86 | Button/colors/icon_focus_color = Color(0.0784314, 0.109804, 0.129412, 1) 87 | Button/colors/icon_hover_color = Color(0.0784314, 0.109804, 0.129412, 1) 88 | Button/colors/icon_hover_pressed_color = Color(0.227451, 0.72549, 0.603922, 1) 89 | Button/colors/icon_normal_color = Color(0.0784314, 0.109804, 0.129412, 1) 90 | Button/colors/icon_pressed_color = Color(0.227451, 0.72549, 0.603922, 1) 91 | Button/styles/focus = SubResource("StyleBoxFlat_ek0y3") 92 | Button/styles/hover = ExtResource("2_du6h5") 93 | Button/styles/hover_pressed = null 94 | Button/styles/normal = ExtResource("3_a8j1f") 95 | Button/styles/pressed = SubResource("StyleBoxFlat_rjkuq") 96 | PanelContainer/styles/panel = SubResource("StyleBoxFlat_x7u0w") 97 | ScrollContainer/styles/panel = SubResource("StyleBoxFlat_dln2q") 98 | VBoxContainer/constants/separation = 8 99 | VScrollBar/styles/grabber = SubResource("StyleBoxFlat_wk7ot") 100 | VScrollBar/styles/grabber_highlight = SubResource("StyleBoxFlat_jidrt") 101 | VScrollBar/styles/grabber_pressed = SubResource("StyleBoxFlat_o2xwc") 102 | VScrollBar/styles/scroll = SubResource("StyleBoxFlat_ul127") 103 | --------------------------------------------------------------------------------