- Home /
Unity GUI Texture with file path
Hello,
I am creating a level selection screen. Every level will has it's own picture in the selection screen. Usually, to draw a texture to the GUI, we need to create a variable to store it. However at 70 levels, that would be rather complicated.
So, is it posibble to draw a texure to the GUI by using it's file path, rather than a variable? That way I can store the paths in an array, and my job would be much easier.
So, is it possible, and if it is, than how?
Thanks!
Answer by Tct1856 · Aug 14, 2011 at 10:10 AM
Hi,
you could use Resources.Load(, Texture2D), this function loads a texture asset from Assets\\Resources directory, which can be used by your GUI code.
Your answer
Follow this Question
Related Questions
How to change rect size? 2 Answers
Multiple buttons causing flickering on several draw textures. 0 Answers
Why doesn't my texture show up? 1 Answer
Mathf.Lerp 2 Answers
render texture assigned to camera now it doesn't render anything at all? 1 Answer