-
Notifications
You must be signed in to change notification settings - Fork 8
/
demo.tscn
80 lines (58 loc) · 2.36 KB
/
demo.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[gd_scene load_steps=7 format=2]
[ext_resource path="res://Gobot/tps_demo.tscn" type="PackedScene" id=1]
[ext_resource path="res://TrokaraMapDemo/TrokaraDemoMap_V6.tscn" type="PackedScene" id=2]
[ext_resource path="res://velocitymeter.gd" type="Script" id=5]
[sub_resource type="GDScript" id=1]
script/source = "# Press 1 to switch to FPS, press 2 to switch to TPS
extends Spatial
const FPS := preload(\"res://Gobot/fps_demo.tscn\")
const TPS := preload(\"res://Gobot/tps_demo.tscn\")
var pivot_node: ControllablePivot
func _ready():
pivot_node = get_tree().get_nodes_in_group(\"PivotNode\")[0]
func _input(event):
if event.is_action_pressed(\"ui_cancel\"):
get_tree().quit()
elif event.is_action_pressed(\"fullscreen\"):
OS.window_fullscreen = not OS.window_fullscreen
elif event.is_action_pressed(\"mouse lock\"):
pivot_node.mouse_lock = not pivot_node.mouse_lock
elif event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
pivot_node.mouse_lock = true
elif event.is_action_pressed(\"fps\") and has_node(\"TPSDemo\"):
var fps: Spatial = FPS.instance()
add_child(fps)
fps.global_transform = $TPSDemo.global_transform
$TPSDemo.queue_free()
elif event.is_action_pressed(\"tps\") and has_node(\"FPSDemo\"):
var tps: Spatial = TPS.instance()
add_child(tps)
tps.global_transform = $FPSDemo.global_transform
$FPSDemo.queue_free()
elif event.is_action_pressed(\"ui_focus_next\"):
var img := get_viewport().get_texture().get_data()
img.flip_y()
# warning-ignore:return_value_discarded
img.save_png(\"screenshot.png\")
"
[sub_resource type="ProceduralSky" id=2]
sky_energy = 1.4
ground_bottom_color = Color( 0.160784, 0.376471, 0.364706, 1 )
ground_horizon_color = Color( 0.466667, 0.631373, 0.419608, 1 )
sun_energy = 2.0
[sub_resource type="Environment" id=3]
background_mode = 2
background_sky = SubResource( 2 )
[node name="Demo" type="Spatial"]
script = SubResource( 1 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 3 )
[node name="TPSDemo" parent="." instance=ExtResource( 1 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.0518563, 0, -0.173705 )
[node name="CanvasLayer" type="Control" parent="TPSDemo"]
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
scale = 0.5
[node name="TrokaraDemoMap" parent="." instance=ExtResource( 2 )]