Виртуальный курсор (для управления с геймпада)

This commit is contained in:
Евгений Титаренко 2024-08-09 19:07:35 +03:00
parent d42bd00c3d
commit bbb66a5273
12 changed files with 135 additions and 8 deletions

30
scripts/VirtualCursor.cs Normal file
View file

@ -0,0 +1,30 @@
using Godot;
using System;
public partial class VirtualCursor : Node2D
{
//[Export] public Node2D Cursor;
protected Sprite2D CursorSprite;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
CursorSprite = (Sprite2D)FindChild("CursorSprite");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public override void _Input(InputEvent @event)
{
// base._Input(@event);
//
// if (@event is InputEventMouseMotion eventMouseMotion)
// {
// CursorSprite.Position = eventMouseMotion.Position - Constants.HalfScreenSize + Position;
// }
}
}