GUILayout.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. public abstract class GUILayout : ScriptObject
  6. {
  7. public GUILabel AddLabel(GUIContent content, GUIElementStyle style, params GUIOption[] options)
  8. {
  9. return new GUILabel(this, content, style, options);
  10. }
  11. public GUILabel AddLabel(GUIContent content, params GUIOption[] options)
  12. {
  13. return new GUILabel(this, content, null, options);
  14. }
  15. public GUIButton AddButton(GUIContent content, GUIElementStyle style, params GUIOption[] options)
  16. {
  17. return new GUIButton(this, content, style, options);
  18. }
  19. public GUIButton AddButton(GUIContent content, GUIElementStyle style)
  20. {
  21. return new GUIButton(this, content, style, new GUIOption[0]);
  22. }
  23. public GUIButton AddButton(GUIContent content, params GUIOption[] options)
  24. {
  25. return new GUIButton(this, content, null, options);
  26. }
  27. public GUITexture AddTexture(SpriteTexture texture, GUIImageScaleMode scale, GUIElementStyle style, params GUIOption[] options)
  28. {
  29. return new GUITexture(this, texture, scale, style, options);
  30. }
  31. public GUITexture AddTexture(SpriteTexture texture, GUIImageScaleMode scale, params GUIOption[] options)
  32. {
  33. return new GUITexture(this, texture, scale, null, options);
  34. }
  35. public GUITexture AddTexture(SpriteTexture texture, GUIElementStyle style, params GUIOption[] options)
  36. {
  37. return new GUITexture(this, texture, GUIImageScaleMode.StretchToFit, style, options);
  38. }
  39. public GUITexture AddTexture(SpriteTexture texture, params GUIOption[] options)
  40. {
  41. return new GUITexture(this, texture, GUIImageScaleMode.StretchToFit, null, options);
  42. }
  43. public GUITextBox AddTextBox(bool multiline, GUIElementStyle style, params GUIOption[] options)
  44. {
  45. return new GUITextBox(this, multiline, style, options);
  46. }
  47. public GUITextBox AddTextBox(bool multiline, params GUIOption[] options)
  48. {
  49. return new GUITextBox(this, multiline, null, options);
  50. }
  51. public GUITextBox AddTextBox(GUIElementStyle style, params GUIOption[] options)
  52. {
  53. return new GUITextBox(this, false, style, options);
  54. }
  55. public GUITextBox AddTextBox(params GUIOption[] options)
  56. {
  57. return new GUITextBox(this, false, null, options);
  58. }
  59. public GUIScrollArea AddScrollArea(GUIElementStyle style, params GUIOption[] options)
  60. {
  61. return new GUIScrollArea(this, style, options);
  62. }
  63. public GUIScrollArea AddScrollArea(params GUIOption[] options)
  64. {
  65. return new GUIScrollArea(this, null, options);
  66. }
  67. public GUIListBox AddListBox(LocString[] elements, GUIElementStyle style, params GUIOption[] options)
  68. {
  69. return new GUIListBox(this, elements, style, options);
  70. }
  71. public GUIListBox AddListBox(LocString[] elements, params GUIOption[] options)
  72. {
  73. return new GUIListBox(this, elements, null, options);
  74. }
  75. public GUIFixedSpace AddSpace(int size)
  76. {
  77. return new GUIFixedSpace(this, size);
  78. }
  79. public GUIFlexibleSpace AddFlexibleSpace()
  80. {
  81. return new GUIFlexibleSpace(this);
  82. }
  83. [MethodImpl(MethodImplOptions.InternalCall)]
  84. protected static extern void Internal_CreateInstanceXFromArea(GUILayout instance, GUIArea parentArea);
  85. [MethodImpl(MethodImplOptions.InternalCall)]
  86. protected static extern void Internal_CreateInstanceXFromLayout(GUILayout instance, GUILayout parentLayout);
  87. [MethodImpl(MethodImplOptions.InternalCall)]
  88. protected static extern void Internal_CreateInstanceYFromScrollArea(GUILayout instance, GUIScrollArea parentArea);
  89. [MethodImpl(MethodImplOptions.InternalCall)]
  90. protected static extern void Internal_CreateInstanceYFromLayout(GUILayout instance, GUILayout parentLayout);
  91. }
  92. }