#Resource to Image

22 messages · Page 1 of 1 (latest)

bronze sorrel
#

Hi, I'm trying to convert a resource to a image, I'm having a bit of problems though, probably me having like 3 hours of experience...

tired talon
#

What kind of resource?

bronze sorrel
tired talon
#

Well an Image is a Resource

#

What are you trying to do exactly?

bronze sorrel
#

Right now I'm trying to get an image to load from the filesystem

tired talon
#

Like outside of the project?

bronze sorrel
bronze sorrel
#

res://

tired talon
#

Then you would just use sprite.Texture = GD.Load<Texture2D>("res://path/to/file.png")

tired talon
#

You don't need to load twice

#

That's already a loaded resource, so you just assign it

bronze sorrel
#

Oh yeah lol

tired talon
#

It's C#, you need to either cast it or use the parameterized version I posted above

#

Is this godot 4?

bronze sorrel
#

OH I have no idea how I didn't see that

bronze sorrel
tired talon
#

You should probably mention that in the future as well

bronze sorrel
#

Ah sorry, the first time I forgot