Off screen marker

This commit is contained in:
LittleSheep 2024-08-09 16:57:47 +08:00
parent 482bfb04a0
commit 34a1b6133f
7 changed files with 241 additions and 57 deletions

View File

@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=3 uid="uid://bcnhxdbgcdsjb"]
[ext_resource type="Script" path="res://Scripts/Effects/OffScreenMarker.cs" id="1_8oti1"]
[ext_resource type="Texture2D" uid="uid://bn86o1gfcj502" path="res://Sprites/Alert.png" id="2_qatpw"]
[node name="OffScreenMarker" type="Node2D"]
script = ExtResource("1_8oti1")
[node name="Sprite2D" type="Sprite2D" parent="."]
[node name="Arrow" type="Sprite2D" parent="Sprite2D"]
position = Vector2(-20, 1.29804e-13)
rotation = 3.14159
scale = Vector2(0.04, 0.04)
texture = ExtResource("2_qatpw")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://b3gx0bl43lku3"]
[gd_scene load_steps=13 format=3 uid="uid://b3gx0bl43lku3"]
[ext_resource type="Script" path="res://Scripts/Player.cs" id="1_0btyt"]
[ext_resource type="Texture2D" uid="uid://c4als6t3k4myc" path="res://Sprites/Player.png" id="1_cqpqa"]
@ -7,6 +7,7 @@
[ext_resource type="Script" path="res://Scripts/Logic/PlayerInput.cs" id="3_tvoua"]
[ext_resource type="Theme" uid="uid://b4dcn26i0p6ym" path="res://AceTheme.tres" id="4_64t2j"]
[ext_resource type="Script" path="res://Scripts/Effects/CameraShake.cs" id="4_fwngj"]
[ext_resource type="PackedScene" uid="uid://bcnhxdbgcdsjb" path="res://Scenes/OffScreenMarker.tscn" id="7_juwvx"]
[sub_resource type="CircleShape2D" id="CircleShape2D_68yf8"]
radius = 25.6
@ -103,6 +104,9 @@ rotation_smoothing_enabled = true
script = ExtResource("4_fwngj")
Noise = SubResource("FastNoiseLite_cfnx7")
[node name="OffScreenMarker" parent="." node_paths=PackedStringArray("Tracking") instance=ExtResource("7_juwvx")]
Tracking = NodePath("..")
[node name="ReloadTimer" type="Timer" parent="."]
wait_time = 6.0
one_shot = true

View File

@ -0,0 +1,35 @@
using Godot;
namespace AceField.Scripts.Effects;
public partial class OffScreenMarker : Node2D
{
public override void _Process(double delta)
{
var canvas = GetCanvasTransform();
var topLeft = -canvas.Origin / canvas.Scale;
var size = GetViewportRect().Size / canvas.Scale;
SetMarkerPosition(new Rect2(topLeft, size));
SetMarkerRotation();
}
private void SetMarkerPosition(Rect2 bounds)
{
var sprite = GetNode<Sprite2D>("Sprite2D");
sprite.GlobalPosition = new Vector2(
Mathf.Clamp(GlobalPosition.X, bounds.Position.X, bounds.End.X),
Mathf.Clamp(GlobalPosition.Y, bounds.Position.Y, bounds.End.Y)
);
if (bounds.HasPoint(GlobalPosition)) Hide();
else Show();
}
private void SetMarkerRotation()
{
var sprite = GetNode<Sprite2D>("Sprite2D");
var angle = (GlobalPosition - sprite.GlobalPosition).Angle();
sprite.GlobalRotation = angle;
sprite.GetNode<Sprite2D>("Arrow").GlobalRotation = 0;
}
}

BIN
Sprites/Alert.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

34
Sprites/Alert.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bn86o1gfcj502"
path="res://.godot/imported/Alert.png-add14bdc40d4ac79d18d2f38934b24e1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Sprites/Alert.png"
dest_files=["res://.godot/imported/Alert.png-add14bdc40d4ac79d18d2f38934b24e1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@ -1,14 +1,14 @@
[preset.0]
name="iOS"
platform="iOS"
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
export_path="../../../Desktop/AceField.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
@ -18,59 +18,156 @@ encrypt_directory=false
custom_template/debug=""
custom_template/release=""
architectures/arm64=true
application/app_store_team_id=""
application/code_sign_identity_debug=""
application/export_method_debug=1
application/code_sign_identity_release=""
application/export_method_release=0
application/targeted_device_family=2
application/bundle_identifier=""
application/signature=""
application/short_version=""
application/version=""
debug/export_console_wrapper=1
binary_format/embed_pck=true
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
application/modify_resources=true
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
application/launch_screens_interpolation=4
application/export_project_only=false
capabilities/access_wifi=false
capabilities/push_notifications=false
user_data/accessible_from_files_app=false
user_data/accessible_from_itunes_sharing=false
privacy/camera_usage_description=""
privacy/camera_usage_description_localized={}
privacy/microphone_usage_description=""
privacy/microphone_usage_description_localized={}
privacy/photolibrary_usage_description=""
privacy/photolibrary_usage_description_localized={}
icons/iphone_120x120=""
icons/iphone_180x180=""
icons/ipad_76x76=""
icons/ipad_152x152=""
icons/ipad_167x167=""
icons/app_store_1024x1024=""
icons/spotlight_40x40=""
icons/spotlight_80x80=""
icons/settings_58x58=""
icons/settings_87x87=""
icons/notification_40x40=""
icons/notification_60x60=""
storyboard/use_launch_screen_storyboard=true
storyboard/image_scale_mode=0
storyboard/custom_image@2x=""
storyboard/custom_image@3x=""
storyboard/use_custom_bg_color=false
storyboard/custom_bg_color=Color(0, 0, 0, 1)
landscape_launch_screens/iphone_2436x1125=""
landscape_launch_screens/iphone_2208x1242=""
landscape_launch_screens/ipad_1024x768=""
landscape_launch_screens/ipad_2048x1536=""
portrait_launch_screens/iphone_640x960=""
portrait_launch_screens/iphone_640x1136=""
portrait_launch_screens/iphone_750x1334=""
portrait_launch_screens/iphone_1125x2436=""
portrait_launch_screens/ipad_768x1024=""
portrait_launch_screens/ipad_1536x2048=""
portrait_launch_screens/iphone_1242x2208=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
application/export_angle=0
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
$settings = New-ScheduledTaskSettingsSet
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
Start-ScheduledTask -TaskName godot_remote_debug
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
[preset.1]
name="macOS"
platform="macOS"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../../Desktop/AceField.dmg"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
[preset.1.options]
export/distribution_type=1
binary_format/architecture="universal"
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
application/icon=""
application/icon_interpolation=4
application/bundle_identifier="dev.solsynth.experimental.acefield"
application/signature=""
application/app_category="Games"
application/short_version=""
application/version=""
application/copyright=""
application/copyright_localized={}
application/min_macos_version="10.12"
application/export_angle=0
display/high_res=true
xcode/platform_build="14C18"
xcode/sdk_version="13.1"
xcode/sdk_build="22C55"
xcode/sdk_name="macosx13.1"
xcode/xcode_version="1420"
xcode/xcode_build="14C18"
codesign/codesign=3
codesign/installer_identity=""
codesign/apple_team_id="W7HPZ53V6B"
codesign/identity=""
codesign/entitlements/custom_file=""
codesign/entitlements/allow_jit_code_execution=false
codesign/entitlements/allow_unsigned_executable_memory=false
codesign/entitlements/allow_dyld_environment_variables=false
codesign/entitlements/disable_library_validation=false
codesign/entitlements/audio_input=false
codesign/entitlements/camera=false
codesign/entitlements/location=false
codesign/entitlements/address_book=false
codesign/entitlements/calendars=false
codesign/entitlements/photos_library=false
codesign/entitlements/apple_events=false
codesign/entitlements/debugging=false
codesign/entitlements/app_sandbox/enabled=false
codesign/entitlements/app_sandbox/network_server=false
codesign/entitlements/app_sandbox/network_client=false
codesign/entitlements/app_sandbox/device_usb=false
codesign/entitlements/app_sandbox/device_bluetooth=false
codesign/entitlements/app_sandbox/files_downloads=0
codesign/entitlements/app_sandbox/files_pictures=0
codesign/entitlements/app_sandbox/files_music=0
codesign/entitlements/app_sandbox/files_movies=0
codesign/entitlements/app_sandbox/files_user_selected=0
codesign/entitlements/app_sandbox/helper_executables=[]
codesign/custom_options=PackedStringArray()
notarization/notarization=0
privacy/microphone_usage_description=""
privacy/microphone_usage_description_localized={}
privacy/camera_usage_description=""
privacy/camera_usage_description_localized={}
privacy/location_usage_description=""
privacy/location_usage_description_localized={}
privacy/address_book_usage_description=""
privacy/address_book_usage_description_localized={}
privacy/calendar_usage_description=""
privacy/calendar_usage_description_localized={}
privacy/photos_library_usage_description=""
privacy/photos_library_usage_description_localized={}
privacy/desktop_folder_usage_description=""
privacy/desktop_folder_usage_description_localized={}
privacy/documents_folder_usage_description=""
privacy/documents_folder_usage_description_localized={}
privacy/downloads_folder_usage_description=""
privacy/downloads_folder_usage_description_localized={}
privacy/network_volumes_usage_description=""
privacy/network_volumes_usage_description_localized={}
privacy/removable_volumes_usage_description=""
privacy/removable_volumes_usage_description_localized={}
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false

View File

@ -73,7 +73,6 @@ ui_leaderboard={
[rendering]
renderer/rendering_method="mobile"
textures/vram_compression/import_etc2_astc=true
anti_aliasing/quality/msaa_2d=2
anti_aliasing/quality/screen_space_aa=1