GUITimeline.generated.cs 5.0 KB

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