41 lines
1.2 KiB
Text
41 lines
1.2 KiB
Text
[gd_scene load_steps=3 format=3 uid="uid://dicavpvkfh86p"]
|
|
|
|
[ext_resource type="PackedScene" uid="uid://q2fys6o0jy6w" path="res://objects/starfield/starfield.tscn" id="1_4yvqf"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_htoqv"]
|
|
resource_name = "StarfieldTest"
|
|
script/source = "extends Control
|
|
|
|
@onready var texture_rect: TextureRect = $SubViewportContainer/SubViewport/TextureRect
|
|
@onready var sub_viewport: SubViewport = $SubViewportContainer/SubViewport
|
|
|
|
var texture: ImageTexture
|
|
|
|
func _ready() -> void:
|
|
texture = ImageTexture.create_from_image(sub_viewport.get_texture().get_image())
|
|
texture_rect.texture = texture
|
|
|
|
func _process(delta: float) -> void:
|
|
texture.update(sub_viewport.get_texture().get_image())
|
|
"
|
|
|
|
[node name="StarfieldTest" type="Control"]
|
|
layout_mode = 3
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
script = SubResource("GDScript_htoqv")
|
|
|
|
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
|
|
layout_mode = 1
|
|
anchors_preset = 15
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 2
|
|
stretch = true
|
|
|
|
[node name="SubViewport" parent="SubViewportContainer" instance=ExtResource("1_4yvqf")]
|
|
size = Vector2i(240, 320)
|