GUICurvesField.generated.cs 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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 with a label.</summary>
  44. /// <param name="labelContent">Content to display in the editor field label.</param>
  45. /// <param name="labelWidth">Width of the label in pixels.</param>
  46. /// <param name="style">
  47. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  48. /// If not specified default style is used.
  49. /// </param>
  50. public GUICurvesField(GUIContent labelContent, uint labelWidth, string style = "")
  51. {
  52. Internal_create1(this, ref labelContent, labelWidth, style);
  53. }
  54. /// <summary>Creates a new GUI editor field with a label.</summary>
  55. /// <param name="labelContent">Content to display in the editor field label.</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, string style = "")
  61. {
  62. Internal_create2(this, ref labelContent, style);
  63. }
  64. /// <summary>Creates a new GUI editor field with a label.</summary>
  65. /// <param name="labelText">String to display in the editor field label.</param>
  66. /// <param name="labelWidth">Width of the label in pixels.</param>
  67. /// <param name="style">
  68. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  69. /// If not specified default style is used.
  70. /// </param>
  71. public GUICurvesField(LocString labelText, uint labelWidth, string style = "")
  72. {
  73. Internal_create3(this, labelText, labelWidth, style);
  74. }
  75. /// <summary>Creates a new GUI editor field with a label.</summary>
  76. /// <param name="labelText">String to display in the editor field label.</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, string style = "")
  82. {
  83. Internal_create4(this, labelText, style);
  84. }
  85. /// <summary>Creates a new GUI editor field without a label.</summary>
  86. /// <param name="style">
  87. /// Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on.
  88. /// If not specified default style is used.
  89. /// </param>
  90. public GUICurvesField(string style = "")
  91. {
  92. Internal_create5(this, style);
  93. }
  94. /// <summary>
  95. /// Returns the curve represented by the field. If the field represents a curve range this returns the minimal curve of
  96. /// that range.
  97. /// </summary>
  98. [ShowInInspector]
  99. [NotNull]
  100. [PassByCopy]
  101. [NativeWrapper]
  102. public AnimationCurve Curve
  103. {
  104. get { return Internal_getCurve(mCachedPtr); }
  105. }
  106. /// <summary>
  107. /// Returns the minimal curve represented by the field containing a curve range. Returns the only available curve if the
  108. /// field doesn't represent a range.
  109. /// </summary>
  110. [ShowInInspector]
  111. [NotNull]
  112. [PassByCopy]
  113. [NativeWrapper]
  114. public AnimationCurve MinCurve
  115. {
  116. get { return Internal_getMinCurve(mCachedPtr); }
  117. }
  118. /// <summary>
  119. /// Returns the maximal curve represented by the field containing a curve range. Returns the only available curve if the
  120. /// field doesn't represent a range.
  121. /// </summary>
  122. [ShowInInspector]
  123. [NotNull]
  124. [PassByCopy]
  125. [NativeWrapper]
  126. public AnimationCurve MaxCurve
  127. {
  128. get { return Internal_getMaxCurve(mCachedPtr); }
  129. }
  130. /// <summary>Sets the size of padding to apply to the left and right sides of the curve drawing, in pixels.</summary>
  131. [ShowInInspector]
  132. [NativeWrapper]
  133. public uint Padding
  134. {
  135. set { Internal_setPadding(mCachedPtr, value); }
  136. }
  137. /// <summary>Triggered when the user clicks on the GUI element.</summary>
  138. partial void OnClicked();
  139. /// <summary>Sets an animation curve to display on the field.</summary>
  140. public void SetCurve(AnimationCurve curve)
  141. {
  142. Internal_setCurve(mCachedPtr, curve);
  143. }
  144. /// <summary>Sets a set of animation curves and displays the difference (range) between them.</summary>
  145. public void SetCurveRange(AnimationCurve curveA, AnimationCurve curveB)
  146. {
  147. Internal_setCurveRange(mCachedPtr, curveA, curveB);
  148. }
  149. /// <summary>Changes the visible range that the GUI element displays.</summary>
  150. /// <param name="xRange">Range of the horizontal area. Displayed area will range from [0, xRange].</param>
  151. /// <param name="yRange">Range of the vertical area. Displayed area will range from [-yRange * 0.5, yRange * 0.5]</param>
  152. public void SetRange(float xRange, float yRange)
  153. {
  154. Internal_setRange(mCachedPtr, xRange, yRange);
  155. }
  156. /// <summary>Returns the offset at which the displayed timeline values start at.</summary>
  157. /// <param name="offset">Value to start the timeline values at, where x = time, y = value.</param>
  158. public void SetOffset(Vector2 offset)
  159. {
  160. Internal_setOffset(mCachedPtr, ref offset);
  161. }
  162. /// <summary>Centers and zooms the view to fully display the provided set of curves.</summary>
  163. public void CenterAndZoom()
  164. {
  165. Internal_centerAndZoom(mCachedPtr);
  166. }
  167. [MethodImpl(MethodImplOptions.InternalCall)]
  168. private static extern void Internal_setCurve(IntPtr thisPtr, AnimationCurve curve);
  169. [MethodImpl(MethodImplOptions.InternalCall)]
  170. private static extern void Internal_setCurveRange(IntPtr thisPtr, AnimationCurve curveA, AnimationCurve curveB);
  171. [MethodImpl(MethodImplOptions.InternalCall)]
  172. private static extern AnimationCurve Internal_getCurve(IntPtr thisPtr);
  173. [MethodImpl(MethodImplOptions.InternalCall)]
  174. private static extern AnimationCurve Internal_getMinCurve(IntPtr thisPtr);
  175. [MethodImpl(MethodImplOptions.InternalCall)]
  176. private static extern AnimationCurve Internal_getMaxCurve(IntPtr thisPtr);
  177. [MethodImpl(MethodImplOptions.InternalCall)]
  178. private static extern void Internal_setRange(IntPtr thisPtr, float xRange, float yRange);
  179. [MethodImpl(MethodImplOptions.InternalCall)]
  180. private static extern void Internal_setOffset(IntPtr thisPtr, ref Vector2 offset);
  181. [MethodImpl(MethodImplOptions.InternalCall)]
  182. private static extern void Internal_centerAndZoom(IntPtr thisPtr);
  183. [MethodImpl(MethodImplOptions.InternalCall)]
  184. private static extern void Internal_setPadding(IntPtr thisPtr, uint padding);
  185. [MethodImpl(MethodImplOptions.InternalCall)]
  186. private static extern void Internal_create(GUICurvesField managedInstance, CurveDrawOptions drawOptions, ref GUIContent labelContent, uint labelWidth, string style);
  187. [MethodImpl(MethodImplOptions.InternalCall)]
  188. private static extern void Internal_create0(GUICurvesField managedInstance, CurveDrawOptions drawOptions, LocString labelText, uint labelWidth, string style);
  189. [MethodImpl(MethodImplOptions.InternalCall)]
  190. private static extern void Internal_create1(GUICurvesField managedInstance, ref GUIContent labelContent, uint labelWidth, string style);
  191. [MethodImpl(MethodImplOptions.InternalCall)]
  192. private static extern void Internal_create2(GUICurvesField managedInstance, ref GUIContent labelContent, string style);
  193. [MethodImpl(MethodImplOptions.InternalCall)]
  194. private static extern void Internal_create3(GUICurvesField managedInstance, LocString labelText, uint labelWidth, string style);
  195. [MethodImpl(MethodImplOptions.InternalCall)]
  196. private static extern void Internal_create4(GUICurvesField managedInstance, LocString labelText, string style);
  197. [MethodImpl(MethodImplOptions.InternalCall)]
  198. private static extern void Internal_create5(GUICurvesField managedInstance, string style);
  199. private void Internal_onClicked()
  200. {
  201. OnClicked();
  202. }
  203. }
  204. /** @} */
  205. }