extends Reference


var filePrexif = "user://colorTiles"


# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.

func loadTexture(lat, lon):
	var texName = getTexName(lat, lon)
	print("opening texture "+texName)
	var image = Image.new()
	var err = image.load(texName)
	if err != OK:
		print("error opening tex ", err)
	var tex = ImageTexture.new()
	tex.create_from_image(image, 0)
	return tex
	
func getTexName(lat, lon):
	return "%s/m-%s-%s.png" % [filePrexif, (int(lat)+90)%180, (int(lon)+180)%360]
	#return "res://tex/grid.png"



# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass
