GUIBase.cs 1.5 KB

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