17 lines
498 B
GDScript
17 lines
498 B
GDScript
extends Node3D
|
|
class_name VGDLObject
|
|
|
|
@onready var mesh_instance_3d: MeshInstance3D = $MeshInstance3D
|
|
|
|
var renderer: VGDLRenderer = null
|
|
|
|
func update_object_state(object_state: JSObject):
|
|
#if object_state.img:
|
|
#icon.texture = load("res://sprites/%s.png" % [object_state.img])
|
|
#if object_state.Z:
|
|
#icon.z_index = object_state.Z
|
|
position.x = object_state.location.x * renderer.PIXEL_RATIO
|
|
position.y = object_state.location.y * renderer.PIXEL_RATIO
|
|
if object_state.hidden:
|
|
visible = false
|