Anyone know if there is a way to used images that have been stored in FileStorage in a UI element?
Solved Using stored image in UI
Discussion in 'Rust Development' started by k1lly0u, Apr 17, 2016.
-
If you are talking about storing an image in the FileStorage first and then later using it for an Image or RawImage component on the UI then yes, there is a way.
To use an image through the FileStorage you basically have to do 4 things:
1. Download the image from a given URL
2. Store it in the FileStorage
3. Keep track of the returned ID
4.Use the ID for the png variable in your Image or RawImage component
I deployed this system in my Kill Feed for Rust | Oxide plugin, so if you want further guidance you should probably just look at my plugins source code. Especially at the region "FileManager" which is responsible for storing the images associated with the URLs. -
I have already sorted the file storage out, I was just curious whether I could use it with the UI. I was hoping it would reduce the image load time enough so I can have the image change position without it looking so horrible.
Perhaps you can shed some light on another issue. Is there a way to use images with out the loss of color saturation?
Thanks for the help
[DOUBLEPOST=1460891629][/DOUBLEPOST]Nevermind, it seems using a stored image fixes it. Thanks again