Skip to content

Instantly share code, notes, and snippets.

@greggman
Created August 8, 2015 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggman/9996532dc7a9ac442298 to your computer and use it in GitHub Desktop.
Save greggman/9996532dc7a9ac442298 to your computer and use it in GitHub Desktop.
Example of Unity GUI vs IMGUI
// IMGUI
ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("OK"))
{
// do stuff
}
ImGui::InputText("string", buf, 256);
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
// Unity
GUILayout.Label("Hello, world " + 123);
if (GUILayout.Button("OK"))
{
// do stuff
}
str = GUILayout.TextField("string", str);
GUILayout.Label("float");
f = GUILayout.HorizontalSlider(f, 0.0f, 1.0f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment