3d_in_2d.tscn 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. [gd_scene load_steps=11 format=3 uid="uid://xwkspajfdmd7"]
  2. [ext_resource type="Script" path="res://3d_in_2d.gd" id="1"]
  3. [ext_resource type="Texture2D" uid="uid://q5bonn8iowbc" path="res://robot_demo.png" id="2"]
  4. [ext_resource type="PackedScene" uid="uid://8nlipuu0ceal" path="res://robot_3d.tscn" id="3"]
  5. [sub_resource type="ViewportTexture" id="ViewportTexture_2squv"]
  6. viewport_path = NodePath("SubViewport")
  7. [sub_resource type="AtlasTexture" id="2"]
  8. atlas = ExtResource("2")
  9. region = Rect2(0, 0, 64, 64)
  10. [sub_resource type="AtlasTexture" id="3"]
  11. atlas = ExtResource("2")
  12. region = Rect2(64, 0, 64, 64)
  13. [sub_resource type="AtlasTexture" id="4"]
  14. atlas = ExtResource("2")
  15. region = Rect2(128, 0, 64, 64)
  16. [sub_resource type="AtlasTexture" id="5"]
  17. atlas = ExtResource("2")
  18. region = Rect2(192, 0, 64, 64)
  19. [sub_resource type="AtlasTexture" id="6"]
  20. atlas = ExtResource("2")
  21. region = Rect2(256, 0, 64, 64)
  22. [sub_resource type="SpriteFrames" id="7"]
  23. animations = [{
  24. "frames": [SubResource("2"), SubResource("3"), SubResource("4"), SubResource("5"), SubResource("6")],
  25. "loop": true,
  26. "name": &"default",
  27. "speed": 5.0
  28. }]
  29. [node name="3Din2D" type="Node2D"]
  30. script = ExtResource("1")
  31. [node name="SubViewport" type="SubViewport" parent="."]
  32. transparent_bg = true
  33. msaa_3d = 2
  34. size = Vector2i(300, 300)
  35. render_target_update_mode = 4
  36. [node name="Robot3D" parent="SubViewport" instance=ExtResource("3")]
  37. [node name="ViewportSprite" type="Sprite2D" parent="."]
  38. position = Vector2(650, 300)
  39. texture = SubResource("ViewportTexture_2squv")
  40. [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
  41. position = Vector2(350, 300)
  42. scale = Vector2(3, 3)
  43. frames = SubResource("7")
  44. [node name="Camera2D" type="Camera2D" parent="."]
  45. offset = Vector2(512, 300)
  46. current = true