Skip to content

Memorix101/MonoGame_BasicGUI

Repository files navigation

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

About

Rebuilding the Legacy GUI from Unity3D for MonoGame

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages