Godot Engine 3.2 Alpha2
tscn即Godot的场景文件,t代表text scn是scene的缩写,是一种人类可读的文本格式。
例如下面这个场景
其场景文件的内容如下:
[gd_scene load_steps=7 format=2]
[ext_resource path="res://my_font.tres" type="DynamicFont" id=1]
[ext_resource path="res://mesh_instance.gd" type="Script" id=2]
[ext_resource path="res://hud.tscn" type="PackedScene" id=3]
[sub_resource type="ViewportTexture" id=1]
viewport_path = NodePath("mesh_instance/sprite_3d/viewport")
[sub_resource type="CubeMesh" id=2]
[sub_resource type="ViewportTexture" id=3]
viewport_path = NodePath("mesh_instance/sprite_3d/viewport")
[node name="game" type="Node"]
[node name="camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10.3015 )
[node name="sprite_3d" parent="camera" instance=ExtResource( 3 )]
texture = SubResource( 1 )
[node name="mesh_instance" type="MeshInstance" parent="."]
transform = Transform( 0.82934, 0, 0.558744, 0, 1, 0, -0.558744, 0, 0.82934, 0, 0, 0 )
mesh = SubResource( 2 )
material/0 = null
script = ExtResource( 2 )
[node name="sprite_3d" parent="mesh_instance" instance=ExtResource( 3 )]
texture = SubResource( 3 )
[node name="label" type="Label" parent="mesh_instance/sprite_3d/viewport" index="0"]
margin_right = 40.0
margin_bottom = 14.0
custom_fonts/font = ExtResource( 1 )
text = "Hello"
[editable path="mesh_instance/sprite_3d"]