GUICurvesField.generated.cs 10 KB

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