- Home /
Question by
CantUnderstandJS · Feb 12, 2013 at 01:14 AM ·
guitextresolutioncurrent
How to input a current resolution on GuiText?
Hi Unity community.. I want to put my current resolution on GUItext.. How i can do this?
Comment
Answer by Danmietz · Feb 12, 2013 at 01:24 AM
You can access your current resolution through
Screen.width;
Screen.height;
If you have a script that references a GUIText, you can change its text through
myGUIText.text = "newText";
...putting these two together, you'll get something that looks like this;
public GUIText m_text;
void Update ()
{
m_text.text = "width: " + Screen.width + ", height: " + Screen.height;
}
Hope this helps.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092540im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
GUI.Label question about Resolution 1 Answer
Story Text to GUI Boxes 0 Answers
Menu screen for different resolutions 1 Answer
Trying to make an ASCII UI based game 0 Answers