extends Viewport

export (NodePath) var rendering_texture_rect_path
onready var rendering_texture_rect = get_node(rendering_texture_rect_path)
onready var texture_offset = rendering_texture_rect.rect_global_position

func spawn_decal_at_world_position(decal, world_position):
	var new_decal = decal.instance()
	var decal_position = world_position
	decal_position += texture_offset * Vector2(-1,1)
	decal_position.y = size.y - decal_position.y
	new_decal.position = decal_position
	add_child(new_decal)
	pass
