stars
This commit is contained in:
parent
cb3d54b9c2
commit
6b92473eeb
5 changed files with 368 additions and 1 deletions
41
objects/starfield/starfield_test.tscn
Normal file
41
objects/starfield/starfield_test.tscn
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
[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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue