Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Pause Demo - Object not rotating + 4.0 changes #701

Merged
merged 1 commit into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion misc/pause/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A demo showing how a game made in Godot can be paused.

Language: GDScript

Renderer: GLES 2
Renderer: Vulkan Mobile

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

Expand Down
28 changes: 13 additions & 15 deletions misc/pause/icon.png.import
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
[remap]

importer="texture"
type="StreamTexture2D"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://dwd6n870wja23"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
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/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1
6 changes: 3 additions & 3 deletions misc/pause/pause_button.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ func _ready():
process_mode = Node.PROCESS_MODE_ALWAYS


func _toggled(button_pressed):
func _toggled(is_button_pressed):
# Pause or unpause the SceneTree based on whether the button is
# toggled on or off.
get_tree().paused = button_pressed
if button_pressed:
get_tree().paused = is_button_pressed
if is_button_pressed:
text = "Unpause"
else:
text = "Pause"
8 changes: 4 additions & 4 deletions misc/pause/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=4
config_version=5

[application]

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

[display]

window/dpi/allow_hidpi=true
window/stretch/mode="2d"
window/stretch/mode="viewport"
window/stretch/aspect="expand"

[gdnative]
Expand All @@ -27,7 +27,7 @@ singletons=[]

[rendering]

quality/driver/driver_name="GLES2"
vulkan/rendering/back_end=1
quality/intended_usage/framebuffer_allocation=3
vram_compression/import_etc=true
vram_compression/import_etc2=false
Expand Down
29 changes: 13 additions & 16 deletions misc/pause/spinpause.tscn
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3 uid="uid://cwa8rglnrg4yb"]

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

[sub_resource type="BoxMesh" id=1]
[sub_resource type="BoxMesh" id="1"]

[sub_resource type="Animation" id=2]
[sub_resource type="Animation" id="2"]
length = 10.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Cube:rotation_degrees")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Cube:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 10),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(0, -360, 0)]
"values": [Vector3(0, 0, 0), Vector3(0, -6.28319, 0)]
}

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

[node name="Cube" type="MeshInstance3D" parent="."]
mesh = SubResource( 1 )
surface_material_override/0 = null
mesh = SubResource( "1" )

[node name="Camera3D" type="Camera3D" parent="."]
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)
transform = Transform3D(0.707107, -0.241845, 0.664463, 0, 0.939693, 0.34202, -0.707107, -0.241845, 0.664463, 2, 1, 2)
fov = 74.0
near = 0.1

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "spin"
anims/spin = SubResource( 2 )
anims/spin = SubResource( "2" )

[node name="SpotLight3D" type="SpotLight3D" parent="."]
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)
transform = Transform3D(0.707107, -0.353554, 0.612373, 0, 0.866026, 0.5, -0.707107, -0.353554, 0.612373, 2, 2, 2)
spot_range = 6.0

[node name="PauseButton" type="Button" parent="."]
Expand All @@ -49,7 +47,6 @@ offset_left = -125.0
offset_top = 150.0
offset_right = 125.0
offset_bottom = 200.0
rect_pivot_offset = Vector2(123, 25)
toggle_mode = true
text = "Pause"
script = ExtResource( 1 )
script = ExtResource( "1" )