tweak camera

This commit is contained in:
Nitwel 2023-12-10 01:48:39 +01:00
parent b8b3dfec08
commit 70c18fc5e7

View File

@ -5,6 +5,7 @@ extends StaticBody3D
@onready var view = $View @onready var view = $View
@onready var http_request = $HTTPRequest @onready var http_request = $HTTPRequest
@onready var mesh = $MeshInstance3D
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
@ -20,12 +21,14 @@ func _ready():
func set_state(stateInfo): func set_state(stateInfo):
if stateInfo == null: if stateInfo == null:
view.texture = null view.texture = null
mesh.visible = true
return return
var state = stateInfo["state"] var state = stateInfo["state"]
if state == "unavailable": if state == "unavailable":
view.texture = null view.texture = null
mesh.visible = true
return return
if stateInfo["attributes"].has("entity_picture"): if stateInfo["attributes"].has("entity_picture"):
@ -53,6 +56,7 @@ func load_image(url: String):
var texture = ImageTexture.create_from_image(image) var texture = ImageTexture.create_from_image(image)
view.texture = texture view.texture = texture
view.pixel_size = pixel_size view.pixel_size = pixel_size
mesh.visible = false
func _save(): func _save():
return { return {