added fullscreen

This commit is contained in:
2022-11-12 00:08:18 +01:00
parent 86989f7fce
commit fab7188747
4 changed files with 34 additions and 3 deletions

View File

@@ -60,6 +60,12 @@ move_down={
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
fullscreen={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":true,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
[mono]

View File

@@ -1,9 +1,11 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://scenes/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/World.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/Main.cs" type="Script" id=3]
[node name="Main" type="Node2D"]
script = ExtResource( 3 )
[node name="World" parent="." instance=ExtResource( 2 )]

View File

@@ -12,7 +12,7 @@ animations = [ {
} ]
[sub_resource type="CapsuleShape2D" id=2]
radius = 11.0
radius = 46.0
height = 4.0
[node name="Player" type="Area2D"]
@@ -22,7 +22,7 @@ __meta__ = {
}
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
scale = Vector2( 0.2, 0.2 )
scale = Vector2( 0.7, 0.7 )
frames = SubResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]

23
src/Main.cs Normal file
View File

@@ -0,0 +1,23 @@
using Godot;
using System;
public class Main : Node2D
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
public override async void _Process(float delta)
{
if (Input.IsActionJustReleased("fullscreen"))
{
OS.WindowFullscreen = !OS.WindowFullscreen;
}
}
}