- Home /
how to make information slideshow?
Hello, I am quite new to Unity and need help with a simple task. I want to make information slideshow with GUI.button and it does not run. This is my script so far:
using UnityEngine;
using System.Collections;
public class InfoKlik : MonoBehaviour {
public Transform target1;
public string info1,info2,info3;
public Vector2 scrollPosition1 = Vector2.zero;
public bool show=false;
public GUISkin guiSkin;
private float guiRatio;
private float sWidth;
private Vector3 GUIsF;
public float X = 0;
public float Y = 0;
public float width = 10f;
public float height = 5f;
void Awake(){
sWidth = Screen.width;
guiRatio = sWidth/1920;
GUIsF = new Vector3(guiRatio,guiRatio,1); }
void OnGUI(){
if(GUI.Button((new Rect (X, Y, width, height),"Hello"))
{
ShowInfromation ();
}
void ShowInformation(){
GUI.BeginGroup(new Rect(Screen.width/2-200,Screen.height/2-250,800,500));
GUI.Box(new Rect(0,50,405,360),"Infromation");
scrollPosition1 = GUI.BeginScrollView(new Rect(30,0,250,390),scrollPosition1, new Rect(0,0,1150,200));
info1 = GUI.TextArea(new Rect(0,300,500,50),info1,200);
info2 = GUI.TextArea(new Rect(400,300,350,50),info2,200);
info3 = GUI.TextArea(new Rect(800,300,350,50),info3,200);
GUI.EndScrollView();
GUI.EndGroup();
}
}
}
Comment
Your answer
Follow this Question
Related Questions
GUITexture on/off using GUILayout.Button 0 Answers
[HELP] C# GUI, not showing up in camera 0 Answers
touch buttons function OnGUI issue 1 Answer
How-to-make-GUI-Buttons-on-GUI-Texture-resolution-independent 0 Answers
Button Touch for Android 2 Answers