TextureLoader.gd 510 B

12345678910111213141516171819202122232425
  1. extends Reference
  2. var filePrexif = "user://colorTiles"
  3. # Called when the node enters the scene tree for the first time.
  4. func _ready():
  5. pass # Replace with function body.
  6. func loadTexture(lat, lon):
  7. lat =int(lat)
  8. lon = int(lon)
  9. var texName = getTexName(lat, lon)
  10. print(texName)
  11. var tex = load(texName)
  12. return tex
  13. func getTexName(lat, lon):
  14. return "%s/m-%s-%s.png" % [filePrexif, lat, lon]
  15. # Called every frame. 'delta' is the elapsed time since the previous frame.
  16. #func _process(delta):
  17. # pass