Skip to content

Commit be59edc

Browse files
authored
Merge pull request #701 from voylin/Fix_Pause_Demo_4.0-dev
Fixing Pause Demo - Object not rotating + 4.0 changes
2 parents bf4425b + 8793b71 commit be59edc

File tree

5 files changed

+34
-39
lines changed

5 files changed

+34
-39
lines changed

misc/pause/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A demo showing how a game made in Godot can be paused.
44

55
Language: GDScript
66

7-
Renderer: GLES 2
7+
Renderer: Vulkan Mobile
88

99
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/147
1010

misc/pause/icon.png.import

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
[remap]
22

33
importer="texture"
4-
type="StreamTexture2D"
5-
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
4+
type="CompressedTexture2D"
5+
uid="uid://dwd6n870wja23"
6+
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
67
metadata={
78
"vram_texture": false
89
}
910

1011
[deps]
1112

1213
source_file="res://icon.png"
13-
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
14+
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
1415

1516
[params]
1617

1718
compress/mode=0
1819
compress/lossy_quality=0.7
19-
compress/hdr_mode=0
20+
compress/hdr_compression=1
2021
compress/bptc_ldr=0
2122
compress/normal_map=0
22-
flags/repeat=0
23-
flags/filter=true
24-
flags/mipmaps=false
25-
flags/anisotropic=false
26-
flags/srgb=2
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
2728
process/fix_alpha_border=true
2829
process/premult_alpha=false
29-
process/HDR_as_SRGB=false
30-
process/invert_color=false
3130
process/normal_map_invert_y=false
32-
stream=false
33-
size_limit=0
34-
detect_3d=true
35-
svg/scale=1.0
31+
process/hdr_as_srgb=false
32+
process/size_limit=0
33+
detect_3d/compress_to=1

misc/pause/pause_button.gd

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ func _ready():
88
process_mode = Node.PROCESS_MODE_ALWAYS
99

1010

11-
func _toggled(button_pressed):
11+
func _toggled(is_button_pressed):
1212
# Pause or unpause the SceneTree based on whether the button is
1313
# toggled on or off.
14-
get_tree().paused = button_pressed
15-
if button_pressed:
14+
get_tree().paused = is_button_pressed
15+
if is_button_pressed:
1616
text = "Unpause"
1717
else:
1818
text = "Pause"

misc/pause/project.godot

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
; [section] ; section goes between []
77
; param=value ; assign values to parameters
88

9-
config_version=4
9+
config_version=5
1010

1111
[application]
1212

1313
config/name="Pause"
1414
config/description="A demo showing how a game made in Godot can be paused."
1515
run/main_scene="res://spinpause.tscn"
1616
config/icon="res://icon.png"
17+
config/features=PackedStringArray("4.0")
1718

1819
[display]
1920

20-
window/dpi/allow_hidpi=true
21-
window/stretch/mode="2d"
21+
window/stretch/mode="viewport"
2222
window/stretch/aspect="expand"
2323

2424
[gdnative]
@@ -27,7 +27,7 @@ singletons=[]
2727

2828
[rendering]
2929

30-
quality/driver/driver_name="GLES2"
30+
vulkan/rendering/back_end=1
3131
quality/intended_usage/framebuffer_allocation=3
3232
vram_compression/import_etc=true
3333
vram_compression/import_etc2=false

misc/pause/spinpause.tscn

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
1-
[gd_scene load_steps=4 format=2]
1+
[gd_scene load_steps=4 format=3 uid="uid://cwa8rglnrg4yb"]
22

3-
[ext_resource path="res://pause_button.gd" type="Script" id=1]
3+
[ext_resource type="Script" path="res://pause_button.gd" id="1"]
44

5-
[sub_resource type="BoxMesh" id=1]
5+
[sub_resource type="BoxMesh" id="1"]
66

7-
[sub_resource type="Animation" id=2]
7+
[sub_resource type="Animation" id="2"]
88
length = 10.0
9-
loop = true
109
tracks/0/type = "value"
11-
tracks/0/path = NodePath("Cube:rotation_degrees")
12-
tracks/0/interp = 1
13-
tracks/0/loop_wrap = true
1410
tracks/0/imported = false
1511
tracks/0/enabled = true
12+
tracks/0/path = NodePath("Cube:rotation")
13+
tracks/0/interp = 1
14+
tracks/0/loop_wrap = true
1615
tracks/0/keys = {
1716
"times": PackedFloat32Array(0, 10),
1817
"transitions": PackedFloat32Array(1, 1),
1918
"update": 0,
20-
"values": [Vector3(0, 0, 0), Vector3(0, -360, 0)]
19+
"values": [Vector3(0, 0, 0), Vector3(0, -6.28319, 0)]
2120
}
2221

2322
[node name="PauseScene" type="Node3D"]
2423

2524
[node name="Cube" type="MeshInstance3D" parent="."]
26-
mesh = SubResource( 1 )
27-
surface_material_override/0 = null
25+
mesh = SubResource( "1" )
2826

2927
[node name="Camera3D" type="Camera3D" parent="."]
30-
transform = Transform3D(0.571594, 0.275303, -0.772974, 0, 0.942035, 0.335515, 0.820537, -0.191779, 0.538461, -5.59754, 2.75935, 4.01344)
28+
transform = Transform3D(0.707107, -0.241845, 0.664463, 0, 0.939693, 0.34202, -0.707107, -0.241845, 0.664463, 2, 1, 2)
3129
fov = 74.0
3230
near = 0.1
3331

3432
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
3533
autoplay = "spin"
36-
anims/spin = SubResource( 2 )
34+
anims/spin = SubResource( "2" )
3735

3836
[node name="SpotLight3D" type="SpotLight3D" parent="."]
39-
transform = Transform3D(0.792992, 0.251051, -0.555101, 0, 0.911149, 0.412078, 0.609232, -0.326775, 0.722534, -3.05357, 1.80053, 3.64099)
37+
transform = Transform3D(0.707107, -0.353554, 0.612373, 0, 0.866026, 0.5, -0.707107, -0.353554, 0.612373, 2, 2, 2)
4038
spot_range = 6.0
4139

4240
[node name="PauseButton" type="Button" parent="."]
@@ -49,7 +47,6 @@ offset_left = -125.0
4947
offset_top = 150.0
5048
offset_right = 125.0
5149
offset_bottom = 200.0
52-
rect_pivot_offset = Vector2(123, 25)
5350
toggle_mode = true
5451
text = "Pause"
55-
script = ExtResource( 1 )
52+
script = ExtResource( "1" )

0 commit comments

Comments
 (0)