GUI.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. /// <summary>
  6. /// Provides access to a global <see cref="GUIPanel"/> that renders GUI on the main viewport. Use
  7. /// <see cref="GUIWidget"/> if you need more control over the placement of GUI, or require it to be rendered to a
  8. /// different viewport.
  9. /// </summary>
  10. public static class GUI
  11. {
  12. /// <summary>
  13. /// Skin used for rendering all the GUI elements.
  14. /// </summary>
  15. public static GUISkin Skin
  16. {
  17. get { return Internal_GetSkin(); }
  18. set
  19. {
  20. IntPtr skinPtr = IntPtr.Zero;
  21. if (value != null)
  22. skinPtr = value.GetCachedPtr();
  23. Internal_SetSkin(skinPtr);
  24. }
  25. }
  26. /// <summary>
  27. /// Container into which all GUI elements should be placed.
  28. /// </summary>
  29. public static GUIPanel Panel
  30. {
  31. get { return Internal_GetPanel(); }
  32. }
  33. [MethodImpl(MethodImplOptions.InternalCall)]
  34. private static extern GUISkin Internal_GetSkin();
  35. [MethodImpl(MethodImplOptions.InternalCall)]
  36. private static extern void Internal_SetSkin(IntPtr skin);
  37. [MethodImpl(MethodImplOptions.InternalCall)]
  38. private static extern GUIPanel Internal_GetPanel();
  39. }
  40. }