• Benvenuto in Making Videogames!
  • Dai sfogo alla tua fantasia!
  • Crea il tuo Videogioco!
Benvenuto ospite! Login Registrati




Valutazione discussione:
  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5
Creare un menù che si adatta alla risoluzione dello schermo
#9
Ragazzi ho trovato questa soluzione e sembra funzionare se non che adesso non funzionano più i pulsanti

Codice:
using UnityEngine;
using System.Collections;

public class bootsk : MonoBehaviour
{

public GUIStyle style;
public GUIStyle style1;
public GUIStyle style2;

// Use this for initialization
void Start ()
{

}

// Update is called once per frame
void Update ()
{

}
//Zona Grafica
void OnGUI()
{
if (Screen.width/2 >= 960)
{
GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Premi qui per entrare nel gioco",style);
if(GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Premi qui per tornare al desktop",style1))
{
Application.Quit();
}
GUI.Label (new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Questo è un gioco: non bisogna ripetere questo nella vita reale",style2);
}
else if (Screen.width/2 >= 800)
{
GUI.Label (new Rect(Screen.width / 2, Screen.height / 2, 100, 50),"Questo è un gioco: non bisogna ripetere questo nella vita reale",style2);
GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 + 150, 100, 50),"Premi qui per entrare nel gioco",style);
if(GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 150, 100, 50),"Premi qui per tornare al desktop",style1))
{
Application.Quit();
}
}
}
}


Qualucno sa perchè, ho controllato, gli if non dovrebbero andare in conflitto, se qualcuno ha qualche idea non esiti anche se sbagliata potrebbe ispirare una soluzione a qualcun altro!
 
Rispondi
  


Messaggi in questa discussione
RE: Creare un menù che si adatta alla risoluzione dello schermo - da xGiovi9810x - 22-05-2013, 04:46 PM

Discussioni simili
Discussione Autore Risposte Letto Ultimo messaggio
  Come creare Menù e salvare la partita.. Biagino 8 1,080 21-08-2014, 03:07 PM
Ultimo messaggio: Blackg96
  AI alla Mount and Blade Led 13 1,064 09-02-2014, 10:51 PM
Ultimo messaggio: ManHunter
Bug Main menu professionale Ice 2 1,020 09-07-2012, 10:40 PM
Ultimo messaggio: Skyline

Vai al forum:


Browsing: 1 Ospite(i)