- Home /
GUI.DrawTexture with GUIStyle?
I am currently trying to implement a function, that draws an image (with text) on my screen (Android development).
Currently I've solved this via
GUI.DrawTexture(rect, GUIcontent);
Unfortunately, the DrawTexture-methode has no overloaded function for the usage of GUIStyle. Since I want to use different font styles for the content text, I'd like to know if there is any function that allows me to include the GUIStyle as well. Any help would be appreciated.
Answer by Eric5h5 · Dec 30, 2013 at 09:40 PM
The point of DrawTexture is that it directly draws a texture. You can use GUI.Label instead.
The problem is, that I need it as texture, because I want to transform it (scale it, cut it, etc.). A GUI.Label doesn't support any of those (at least not that I know) and I know no way to tell it to only show half characters for example. Considering your answer, would a better course of action be to look for a way to convert a GUI.Label into a texture?
Based on that assumption, I've solved the problem. I'm sorry for not realizing earlier that DrawTexture is only for for drawing the image. Thanks for your help ^^
$$anonymous$$aybe make a custom control that combines DrawTexture for the texture with Label for the text?
Your answer
![](https://koobas.hobune.stream/wayback/20220613125156im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
GUI toggle help 2 Answers
GUIContent Alignment inside a Button 1 Answer
How do I get the GUI Icon to stretch? 1 Answer
GuiStyle attachment problem 1 Answer
Error on GUIStyle.Draw 2 Answers