- Home /
Text is too small while displaying in device
I customized for About screen. I wrote code for displaying text in screen. But when i run the app in device the texts are too small. See the attached image
using UnityEngine;
using System.Collections;
public class Aboutscreen : MonoBehaviour {
// public GUIStyle emptyButtonStyle;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
GUI.Label(new Rect(10f, 160f, Screen.width, 250f), "1.Print the alphabet image targets located at");
GUI.Label(new Rect(10f, 300f, 400f, 300f), "2.Point any of the animal images");
GUI.Label(new Rect(10f, 460f, 400f, 400f), "3.Finally your kids able to see the 3D animal render on the screen with soundss");
if(GUI.Button(new Rect(80,680,280,200), "start")) {
Application.LoadLevel("25Nov1");
}
GUI.backgroundColor = Color.clear;
if(GUI.Button(new Rect(260,160,120,250), "www.url.net")) {
Application.OpenURL("http://www.url.net");
}
}
}
photo.png
(21.1 kB)
Comment
Best Answer
Answer by PlasmaByte · Dec 29, 2013 at 02:31 PM
You can either use a custom GUI skin, which is probably the best method. Or you can change the text font size at run time.
GUI.skin.label.fontSize = 50; //changes font size to 50 for labels
GUI.skin.button.fontSize = 50; //changes font size to 50 for buttons
Your answer
Follow this Question
Related Questions
Fitting text into label 1 Answer
How do I make my label fit its text? 2 Answers
GUI.Label positioning for many device resolutions 1 Answer
GUI label/text appear/disappear 1 Answer