GUICurvesField.generated.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. using BansheeEngine;
  5. namespace BansheeEditor
  6. {
  7. /** @addtogroup GUIEditor
  8. * @{
  9. */
  10. /// <summary>
  11. /// A composite GUI object representing an editor field. Editor fields are a combination of a label and an input field.
  12. /// Label is optional. This specific implementation displays an animation curve or a range between two animation curves.
  13. /// </summary>
  14. [ShowInInspector]
  15. public partial class GUICurvesField : GUIElement
  16. {
  17. private GUICurvesField(bool __dummy0) { }
  18. protected GUICurvesField() { }
  19. /// <summary>Creates a new GUI editor field with a label.</summary>
  20. /// <param name="drawOptions">Options that control which additional curve elements to draw.</param>
  21. /// <param name="labelContent">Content to display in the editor field label.</param>
  22. /// <param name="labelWidth">Width of the label in pixels.</param>
  23. /// <param name="style">
  24. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  25. /// If not specified default style is used.
  26. /// </param>
  27. public GUICurvesField(CurveDrawOptions drawOptions, GUIContent labelContent, uint labelWidth, string style = "")
  28. {
  29. Internal_create(this, drawOptions, ref labelContent, labelWidth, style);
  30. }
  31. /// <summary>Creates a new GUI editor field with a label.</summary>
  32. /// <param name="drawOptions">Options that control which additional curve elements to draw.</param>
  33. /// <param name="labelText">String to display in the editor field label.</param>
  34. /// <param name="labelWidth">Width of the label in pixels.</param>
  35. /// <param name="style">
  36. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  37. /// If not specified default style is used.
  38. /// </param>
  39. public GUICurvesField(CurveDrawOptions drawOptions, LocString labelText, uint labelWidth, string style = "")
  40. {
  41. Internal_create0(this, drawOptions, labelText, labelWidth, style);
  42. }
  43. /// <summary>Creates a new GUI editor field without a label.</summary>
  44. /// <param name="drawOptions">Options that control which additional curve elements to draw.</param>
  45. /// <param name="style">
  46. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  47. /// If not specified default style is used.
  48. /// </param>
  49. public GUICurvesField(CurveDrawOptions drawOptions, string style = "")
  50. {
  51. Internal_create1(this, drawOptions, style);
  52. }
  53. /// <summary>Creates a new GUI editor field with a label.</summary>
  54. /// <param name="labelContent">Content to display in the editor field label.</param>
  55. /// <param name="labelWidth">Width of the label in pixels.</param>
  56. /// <param name="style">
  57. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  58. /// If not specified default style is used.
  59. /// </param>
  60. public GUICurvesField(GUIContent labelContent, uint labelWidth, string style = "")
  61. {
  62. Internal_create2(this, ref labelContent, labelWidth, style);
  63. }
  64. /// <summary>Creates a new GUI editor field with a label.</summary>
  65. /// <param name="labelContent">Content to display in the editor field label.</param>
  66. /// <param name="style">
  67. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  68. /// If not specified default style is used.
  69. /// </param>
  70. public GUICurvesField(GUIContent labelContent, string style = "")
  71. {
  72. Internal_create3(this, ref labelContent, style);
  73. }
  74. /// <summary>Creates a new GUI editor field with a label.</summary>
  75. /// <param name="labelText">String to display in the editor field label.</param>
  76. /// <param name="labelWidth">Width of the label in pixels.</param>
  77. /// <param name="style">
  78. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  79. /// If not specified default style is used.
  80. /// </param>
  81. public GUICurvesField(LocString labelText, uint labelWidth, string style = "")
  82. {
  83. Internal_create4(this, labelText, labelWidth, style);
  84. }
  85. /// <summary>Creates a new GUI editor field with a label.</summary>
  86. /// <param name="labelText">String to display in the editor field label.</param>
  87. /// <param name="style">
  88. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  89. /// If not specified default style is used.
  90. /// </param>
  91. public GUICurvesField(LocString labelText, string style = "")
  92. {
  93. Internal_create5(this, labelText, style);
  94. }
  95. /// <summary>Creates a new GUI editor field without a label.</summary>
  96. /// <param name="style">
  97. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  98. /// If not specified default style is used.
  99. /// </param>
  100. public GUICurvesField(string style = "")
  101. {
  102. Internal_create6(this, style);
  103. }
  104. /// <summary>
  105. /// Returns the curve represented by the field. If the field represents a curve range this returns the minimal curve of
  106. /// that range.
  107. /// </summary>
  108. [ShowInInspector]
  109. [NotNull]
  110. [PassByCopy]
  111. [NativeWrapper]
  112. public AnimationCurve Curve
  113. {
  114. get { return Internal_getCurve(mCachedPtr); }
  115. }
  116. /// <summary>
  117. /// Returns the minimal curve represented by the field containing a curve range. Returns the only available curve if the
  118. /// field doesn't represent a range.
  119. /// </summary>
  120. [ShowInInspector]
  121. [NotNull]
  122. [PassByCopy]
  123. [NativeWrapper]
  124. public AnimationCurve MinCurve
  125. {
  126. get { return Internal_getMinCurve(mCachedPtr); }
  127. }
  128. /// <summary>
  129. /// Returns the maximal curve represented by the field containing a curve range. Returns the only available curve if the
  130. /// field doesn't represent a range.
  131. /// </summary>
  132. [ShowInInspector]
  133. [NotNull]
  134. [PassByCopy]
  135. [NativeWrapper]
  136. public AnimationCurve MaxCurve
  137. {
  138. get { return Internal_getMaxCurve(mCachedPtr); }
  139. }
  140. /// <summary>Sets the size of padding to apply to the left and right sides of the curve drawing, in pixels.</summary>
  141. [ShowInInspector]
  142. [NativeWrapper]
  143. public uint Padding
  144. {
  145. set { Internal_setPadding(mCachedPtr, value); }
  146. }
  147. /// <summary>Triggered when the user clicks on the GUI element.</summary>
  148. partial void OnClicked();
  149. /// <summary>Sets an animation curve to display on the field.</summary>
  150. public void SetCurve(AnimationCurve curve)
  151. {
  152. Internal_setCurve(mCachedPtr, curve);
  153. }
  154. /// <summary>Sets a set of animation curves and displays the difference (range) between them.</summary>
  155. public void SetCurveRange(AnimationCurve curveA, AnimationCurve curveB)
  156. {
  157. Internal_setCurveRange(mCachedPtr, curveA, curveB);
  158. }
  159. /// <summary>Changes the visible range that the GUI element displays.</summary>
  160. /// <param name="xRange">Range of the horizontal area. Displayed area will range from [0, xRange].</param>
  161. /// <param name="yRange">Range of the vertical area. Displayed area will range from [-yRange * 0.5, yRange * 0.5]</param>
  162. public void SetRange(float xRange, float yRange)
  163. {
  164. Internal_setRange(mCachedPtr, xRange, yRange);
  165. }
  166. /// <summary>Returns the offset at which the displayed timeline values start at.</summary>
  167. /// <param name="offset">Value to start the timeline values at, where x = time, y = value.</param>
  168. public void SetOffset(Vector2 offset)
  169. {
  170. Internal_setOffset(mCachedPtr, ref offset);
  171. }
  172. /// <summary>Centers and zooms the view to fully display the provided set of curves.</summary>
  173. public void CenterAndZoom()
  174. {
  175. Internal_centerAndZoom(mCachedPtr);
  176. }
  177. [MethodImpl(MethodImplOptions.InternalCall)]
  178. private static extern void Internal_setCurve(IntPtr thisPtr, AnimationCurve curve);
  179. [MethodImpl(MethodImplOptions.InternalCall)]
  180. private static extern void Internal_setCurveRange(IntPtr thisPtr, AnimationCurve curveA, AnimationCurve curveB);
  181. [MethodImpl(MethodImplOptions.InternalCall)]
  182. private static extern AnimationCurve Internal_getCurve(IntPtr thisPtr);
  183. [MethodImpl(MethodImplOptions.InternalCall)]
  184. private static extern AnimationCurve Internal_getMinCurve(IntPtr thisPtr);
  185. [MethodImpl(MethodImplOptions.InternalCall)]
  186. private static extern AnimationCurve Internal_getMaxCurve(IntPtr thisPtr);
  187. [MethodImpl(MethodImplOptions.InternalCall)]
  188. private static extern void Internal_setRange(IntPtr thisPtr, float xRange, float yRange);
  189. [MethodImpl(MethodImplOptions.InternalCall)]
  190. private static extern void Internal_setOffset(IntPtr thisPtr, ref Vector2 offset);
  191. [MethodImpl(MethodImplOptions.InternalCall)]
  192. private static extern void Internal_centerAndZoom(IntPtr thisPtr);
  193. [MethodImpl(MethodImplOptions.InternalCall)]
  194. private static extern void Internal_setPadding(IntPtr thisPtr, uint padding);
  195. [MethodImpl(MethodImplOptions.InternalCall)]
  196. private static extern void Internal_create(GUICurvesField managedInstance, CurveDrawOptions drawOptions, ref GUIContent labelContent, uint labelWidth, string style);
  197. [MethodImpl(MethodImplOptions.InternalCall)]
  198. private static extern void Internal_create0(GUICurvesField managedInstance, CurveDrawOptions drawOptions, LocString labelText, uint labelWidth, string style);
  199. [MethodImpl(MethodImplOptions.InternalCall)]
  200. private static extern void Internal_create1(GUICurvesField managedInstance, CurveDrawOptions drawOptions, string style);
  201. [MethodImpl(MethodImplOptions.InternalCall)]
  202. private static extern void Internal_create2(GUICurvesField managedInstance, ref GUIContent labelContent, uint labelWidth, string style);
  203. [MethodImpl(MethodImplOptions.InternalCall)]
  204. private static extern void Internal_create3(GUICurvesField managedInstance, ref GUIContent labelContent, string style);
  205. [MethodImpl(MethodImplOptions.InternalCall)]
  206. private static extern void Internal_create4(GUICurvesField managedInstance, LocString labelText, uint labelWidth, string style);
  207. [MethodImpl(MethodImplOptions.InternalCall)]
  208. private static extern void Internal_create5(GUICurvesField managedInstance, LocString labelText, string style);
  209. [MethodImpl(MethodImplOptions.InternalCall)]
  210. private static extern void Internal_create6(GUICurvesField managedInstance, string style);
  211. private void Internal_onClicked()
  212. {
  213. OnClicked();
  214. }
  215. }
  216. /** @} */
  217. }