- Home /
Changing a GUI String to read as a INT
Hi I'm making a level selector page and I need to put the level number over the GUI button. I have an Array that reads i as the number of the level but how can I get "i" to read out as a string and not a int.
GUI.Button(new Rect(btnX*i,btnY*i,btnSize,btnSize),"1",levelCheck ? lockLvl:btnLvl)
to equal as
GUI.Button(new Rect(btnX*i,btnY*i,btnSize,btnSize),i,levelCheck ? lockLvl:btnLvl)
Comment
Answer by gwubgwub · Feb 16, 2014 at 04:14 PM
GUI.Button(new Rect(btnX*i,btnY*i,btnSize,btnSize),""+i,levelCheck ? lockLvl:btnLvl)
I just did ""+i, and it works perfectly. Just had a blonde moment
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Increase text size over time c# 2 Answers
Any idea why my int wont display on GUI 1 Answer
string + int = variable 2 Answers
Multiple Cars not working 1 Answer