Search Unity

Stage select

Discussion in '2D' started by SilverFoxtail, May 28, 2017.

  1. SilverFoxtail

    SilverFoxtail

    Joined:
    Apr 14, 2017
    Posts:
    1
    I'm trying to make a megaman style select screen for a fangame I'm making. Here is my code. Can you tell me what I'm doing wrong?

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class GUImenu : MonoBehaviour {

    void OnGUI()
    {
    GUILayout.BeginArea(new Rect(50, 50, 50, 50));
    GUILayout.BeginHorizontal();

    GUILayout.Label( "Begin!" );
    GUILayout.EndHorizontal();
    GUILayout.EndArea();
    }
    }
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I am not familiar with megaman select screen, but just tell me what you're hoping for ? A button, that when pressed, begins the game - something like that?

    Whatever the case is, my 1 strong suggestion would be to use the UI game objects (Create -> UI - > (list of things here)) instead of OnGUI. OnGUI (IMGUI) is an older system, and was replaced, a while back now, with the newer system.
    :)

    If you have a specific question after that, please explain what it is / what you're trying to do in your own words, for those of us who might not know your reference point.