SpineTrackEntry.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /******************************************************************************
  2. * Spine Runtimes License Agreement
  3. * Last updated January 1, 2020. Replaces all prior versions.
  4. *
  5. * Copyright (c) 2013-2020, Esoteric Software LLC
  6. *
  7. * Integration of the Spine Runtimes into software or otherwise creating
  8. * derivative works of the Spine Runtimes is permitted under the terms and
  9. * conditions of Section 2 of the Spine Editor License Agreement:
  10. * http://esotericsoftware.com/spine-editor-license
  11. *
  12. * Otherwise, it is permitted to integrate the Spine Runtimes into software
  13. * or otherwise create derivative works of the Spine Runtimes (collectively,
  14. * "Products"), provided that each user of the Products must obtain their own
  15. * Spine Editor license and redistribution of the Products in any form must
  16. * include this license and copyright notice.
  17. *
  18. * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
  19. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
  22. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
  24. * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *****************************************************************************/
  29. #ifndef GODOT_SPINETRACKENTRY_H
  30. #define GODOT_SPINETRACKENTRY_H
  31. #include "core/variant_parser.h"
  32. #include <spine/spine.h>
  33. #include "SpineAnimation.h"
  34. class SpineTrackEntry : public Reference{
  35. GDCLASS(SpineTrackEntry, Reference);
  36. protected:
  37. static void _bind_methods();
  38. private:
  39. spine::TrackEntry *track_entry;
  40. public:
  41. SpineTrackEntry();
  42. ~SpineTrackEntry();
  43. inline void set_spine_object(spine::TrackEntry *t){
  44. track_entry = t;
  45. }
  46. inline spine::TrackEntry *get_spine_object(){
  47. return track_entry;
  48. }
  49. enum MixBlend {
  50. MIXBLEND_SETUP = 0,
  51. MIXBLEND_FIRST,
  52. MIXBLEND_REPLACE,
  53. MIXBLEND_ADD
  54. };
  55. int get_track_index();
  56. Ref<SpineAnimation> get_animation();
  57. bool get_loop();
  58. void set_loop(bool v);
  59. bool get_hold_previous();
  60. void set_hold_previous(bool v);
  61. bool get_reverse();
  62. void set_reverse(bool v);
  63. float get_delay();
  64. void set_delay(float v);
  65. float get_track_time();
  66. void set_track_time(float v);
  67. float get_track_end();
  68. void set_track_end(float v);
  69. float get_animation_start();
  70. void set_animation_start(float v);
  71. float get_animation_last();
  72. void set_animation_last(float v);
  73. float get_animation_time();
  74. float get_time_scale();
  75. void set_time_scale(float v);
  76. float get_alpha();
  77. void set_alpha(float v);
  78. float get_event_threshold();
  79. void set_event_threshold(float v);
  80. float get_attachment_threshold();
  81. void set_attachment_threshold(float v);
  82. float get_draw_order_threshold();
  83. void set_draw_order_threshold(float v);
  84. Ref<SpineTrackEntry> get_next();
  85. bool is_complete();
  86. float get_mix_time();
  87. void set_mix_time(float v);
  88. float get_mix_duration();
  89. void set_mix_duration(float v);
  90. MixBlend get_mix_blend();
  91. void set_mix_blend(MixBlend v);
  92. Ref<SpineTrackEntry> get_mixing_from();
  93. Ref<SpineTrackEntry> get_mixing_to();
  94. void reset_rotation_directions();
  95. };
  96. VARIANT_ENUM_CAST(SpineTrackEntry::MixBlend);
  97. #endif //GODOT_SPINETRACKENTRY_H