GUITimeline.generated.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. /// Base class that can be implemented by GUI elements needing to elements along draw a horizontal timeline.
  14. /// </summary>
  15. [ShowInInspector]
  16. public partial class GUITimeline : GUIElement
  17. {
  18. private GUITimeline(bool __dummy0) { }
  19. protected GUITimeline() { }
  20. /// <summary>Determines the range of values to display on the timeline, in seconds.</summary>
  21. [ShowInInspector]
  22. [NativeWrapper]
  23. public float Range
  24. {
  25. get { return Internal_getRange(mCachedPtr); }
  26. set { Internal_setRange(mCachedPtr, value); }
  27. }
  28. /// <summary>Determines the offset at which the displayed timeline values start at, in seconds.</summary>
  29. [ShowInInspector]
  30. [NativeWrapper]
  31. public float Offset
  32. {
  33. get { return Internal_getOffset(mCachedPtr); }
  34. set { Internal_setOffset(mCachedPtr, value); }
  35. }
  36. /// <summary>Number of frames per second, used for frame selection and marking.</summary>
  37. [ShowInInspector]
  38. [NativeWrapper]
  39. public int FPS
  40. {
  41. get { return Internal_getFPS(mCachedPtr); }
  42. set { Internal_setFPS(mCachedPtr, value); }
  43. }
  44. /// <summary>Frame to display the frame marker on. Set to -1 to clear the frame marker.</summary>
  45. [ShowInInspector]
  46. [NativeWrapper]
  47. public int MarkedFrame
  48. {
  49. get { return Internal_setMarkedFrame0(mCachedPtr); }
  50. set { Internal_setMarkedFrame(mCachedPtr, value); }
  51. }
  52. /// <summary>Sets the size of padding to apply to the left and right sides of the curve drawing, in pixels.</summary>
  53. [ShowInInspector]
  54. [NativeWrapper]
  55. public int Padding
  56. {
  57. get { return Internal_getPadding(mCachedPtr); }
  58. set { Internal_setPadding(mCachedPtr, value); }
  59. }
  60. /// <summary>
  61. /// Uses the assigned FPS, range and physical size to calculate the frame that is under the provided coordinates.
  62. /// </summary>
  63. /// <param name="pixelCoords">Coordinates relative to this GUI element.</param>
  64. /// <returns>Frame that was clicked on, or -1 if the coordinates are outside of valid bounds.</returns>
  65. public int GetFrame(Vector2I pixelCoords)
  66. {
  67. return Internal_getFrame(mCachedPtr, ref pixelCoords);
  68. }
  69. /// <summary>Returns the time at the specified pixel value along the timeline.</summary>
  70. /// <param name="pixel">X coordinate to sample at, relative to this GUI element in pixels.</param>
  71. /// <returns>Time along the curve at the specified coordinate.</returns>
  72. public float GetTime(int pixel)
  73. {
  74. return Internal_getTime(mCachedPtr, pixel);
  75. }
  76. /// <summary>Finds the pixel offset relative to the GUI element&apos;s origin for the specified time.</summary>
  77. /// <param name="time">Time value to return the offset for.</param>
  78. /// <returns>Offset in pixels relative to GUI element&apos;s origin</returns>
  79. public int GetOffset(float time)
  80. {
  81. return Internal_getOffset0(mCachedPtr, time);
  82. }
  83. /// <summary>Returns time for a frame with the specified index. Depends on set range and FPS.</summary>
  84. /// <param name="index">Index of the frame (not a key-frame) to get the time for.</param>
  85. /// <returns>Time of the frame with the provided index.</returns>
  86. public float GetTimeForFrame(int index)
  87. {
  88. return Internal_getTimeForFrame(mCachedPtr, index);
  89. }
  90. [MethodImpl(MethodImplOptions.InternalCall)]
  91. private static extern void Internal_setRange(IntPtr thisPtr, float range);
  92. [MethodImpl(MethodImplOptions.InternalCall)]
  93. private static extern float Internal_getRange(IntPtr thisPtr);
  94. [MethodImpl(MethodImplOptions.InternalCall)]
  95. private static extern void Internal_setOffset(IntPtr thisPtr, float offset);
  96. [MethodImpl(MethodImplOptions.InternalCall)]
  97. private static extern float Internal_getOffset(IntPtr thisPtr);
  98. [MethodImpl(MethodImplOptions.InternalCall)]
  99. private static extern void Internal_setFPS(IntPtr thisPtr, int FPS);
  100. [MethodImpl(MethodImplOptions.InternalCall)]
  101. private static extern int Internal_getFPS(IntPtr thisPtr);
  102. [MethodImpl(MethodImplOptions.InternalCall)]
  103. private static extern void Internal_setMarkedFrame(IntPtr thisPtr, int index);
  104. [MethodImpl(MethodImplOptions.InternalCall)]
  105. private static extern int Internal_setMarkedFrame0(IntPtr thisPtr);
  106. [MethodImpl(MethodImplOptions.InternalCall)]
  107. private static extern int Internal_getFrame(IntPtr thisPtr, ref Vector2I pixelCoords);
  108. [MethodImpl(MethodImplOptions.InternalCall)]
  109. private static extern float Internal_getTime(IntPtr thisPtr, int pixel);
  110. [MethodImpl(MethodImplOptions.InternalCall)]
  111. private static extern int Internal_getOffset0(IntPtr thisPtr, float time);
  112. [MethodImpl(MethodImplOptions.InternalCall)]
  113. private static extern float Internal_getTimeForFrame(IntPtr thisPtr, int index);
  114. [MethodImpl(MethodImplOptions.InternalCall)]
  115. private static extern void Internal_setPadding(IntPtr thisPtr, int padding);
  116. [MethodImpl(MethodImplOptions.InternalCall)]
  117. private static extern int Internal_getPadding(IntPtr thisPtr);
  118. }
  119. /** @} */
  120. }