2
0

GUIBase.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. public class GUIBase : ScriptObject
  6. {
  7. private GUIArea mainArea;
  8. private GUILayout _mainLayout;
  9. public GUILayout main
  10. {
  11. get { return _mainLayout; }
  12. }
  13. public GUISkin skin; // TODO
  14. internal GUIBase()
  15. {
  16. Internal_CreateInstance(this);
  17. mainArea = AddResizableAreaXY(0, 0, 0, 0);
  18. _mainLayout = mainArea.layout;
  19. }
  20. public GUIArea AddArea(int x, int y, int width = 0, int height = 0, short depth = 0)
  21. {
  22. return GUIArea.Create(this, x, y, width, height, depth);
  23. }
  24. public GUIArea AddResizableAreaX(int offsetLeft, int offsetRight, int offsetTop, int height, short depth = 0)
  25. {
  26. return GUIArea.CreateResizableX(this, offsetLeft, offsetRight, offsetTop, height, depth);
  27. }
  28. public GUIArea AddResizableAreaY(int offsetTop, int offsetBottom, int offsetLeft, int width, short depth = 0)
  29. {
  30. return GUIArea.CreateResizableY(this, offsetTop, offsetBottom, offsetLeft, width, depth);
  31. }
  32. public GUIArea AddResizableAreaXY(int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, short depth = 0)
  33. {
  34. return GUIArea.CreateResizableXY(this, offsetLeft, offsetRight, offsetTop, offsetBottom, depth);
  35. }
  36. [MethodImpl(MethodImplOptions.InternalCall)]
  37. private static extern void Internal_CreateInstance(GUIBase instance);
  38. }
  39. }