Skip to content
Rebuilding the Legacy GUI from Unity3D for MonoGame
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Content
GUI
Properties
x64
x86
.gitignore
BasicGUI.csproj
BasicGUI.csproj.user
BasicGUI.sln
Game1.cs
Icon.ico
OpenTK.dll.config
Program.cs
README.md

README.md

MonoGame_BasicGUI

Rebuilding the Legacy GUI from Unity3D for MonoGame

        void OnGUI()
        {
            GUI.Init(spriteBatch, mouseRect);
            GUI.Label(new Rectangle(10, 10, 0, 0), "Test");
            GUI.Label(new Rectangle(15, 200, 0, 0), "WOW !");
            GUI.Box(new Rectangle(500, 150, 100, 100), "BOOOX !");

            if (GUI.Button(new Rectangle(100, 15, 100, 50), "Button !"))
            {
                sound.Play();
                Console.WriteLine("Works!");
            }
       }
        void OnGUI()
        {
            GUI.Init(spriteBatch, mouseRect);
            GUILayout.BeginArea(new Rectangle(500, 0, 100, 50));
            GUILayout.Label("Test1");
            GUILayout.Label("Test2");
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rectangle(600, 0, 100, 50));

            if (GUILayout.Button("Button1"))
            {
                sound1.Play();
            }
            
            GUILayout.Space(1);

            if (GUILayout.Button("Button2"))
            {
                sound2.Play();
            }

            GUILayout.EndArea();
       }

Art by Kenney
Font by Ubuntu

You can’t perform that action at this time.