Reputation: 19
I'm new to Godot/(I believe its C++ on the backend), but I've done a fair bit of python. I'm actually only using it as a robust gui editor, because working with tkinter wasn't looking all too good.
I have .dds files that cannot be moved out of their current folder, and I cannot import them normally - so I believe I am left with the choice to load them during runtime.
As far as I can tell whilst trying to figure this out its due to .dds files being different somehow, but I don't know enough to be able to really understand what's going on. There's lots of documentation about this problem, and I can't tell if it is fixed in this version of Godot or how to get it to work.
Side note: I would be happy with any solution that gets the textures to load during runtime, so long as the resources folder does not contain any of the textures once the Godot instance is closed. I do not have any .dds files in the res:// folder.
I recognise that this is unusual and the simplest answer would be to tell me to not try to do it, but it this case I am forced towards this solution.
This works correctly, and seems the standard way to load textures during runtime
var image = Image.new()
image.load("res://image.jpg")
var image_texture = ImageTexture.new()
$HBoxContainer/ColorRect/ColorRect2/TextureRect.texture = image_texture
These do not work, and return errors
var image = Image.new()
image.load("res://image.dds")
var image_texture = ImageTexture.new()
$HBoxContainer/ColorRect/ColorRect2/TextureRect.texture = image_texture`
var image = Image.new()
image.load("C:/Users/Liam/Desktop/image.dds")
var image_texture = ImageTexture.new()
$HBoxContainer/ColorRect/ColorRect2/TextureRect.texture = image_texture`
I have tried to load them not as images to zero success - but that might be because my syntax was off.
I've tried reading through #69085 and #81126 on Godot engine github but I don't yet have enough experience to know whether it's still possible and how to achieve it.
Upvotes: 0
Views: 119