prepared for nintendo controller support

This commit is contained in:
2022-11-26 12:51:28 +01:00
parent 6ac6d14a44
commit dbeac992bd
2 changed files with 25 additions and 1 deletions

View File

@@ -3,14 +3,23 @@ using System;
public partial class main : Node2D
{
[Export]
public string currentController = Input.GetJoyName(0);
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
//gamepad
currentController = Input.GetJoyName(0);
if (currentController.StartsWith("Nintendo"))
{
}
//fullscreen
if (Input.IsActionJustPressed("hotkey_fullscreen"))
{
if (DisplayServer.WindowGetMode() == DisplayServer.WindowMode.Fullscreen)
@@ -23,4 +32,5 @@ public partial class main : Node2D
}
}
}
}