SpinePathConstraintData.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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_SPINEPATHCONSTRAINTDATA_H
  30. #define GODOT_SPINEPATHCONSTRAINTDATA_H
  31. #include "core/variant_parser.h"
  32. #include <spine/spine.h>
  33. #include "SpineConstraintData.h"
  34. #include "SpineBoneData.h"
  35. #include "SpineSlotData.h"
  36. class SpinePathConstraintData : public SpineConstraintData {
  37. GDCLASS(SpinePathConstraintData, SpineConstraintData);
  38. protected:
  39. static void _bind_methods();
  40. public:
  41. SpinePathConstraintData();
  42. ~SpinePathConstraintData();
  43. virtual inline spine::PathConstraintData *get_spine_data(){
  44. return (spine::PathConstraintData*) SpineConstraintData::get_spine_object();
  45. }
  46. enum PositionMode {
  47. POSITIONMODE_FIXED = 0,
  48. POSITIONMODE_PERCENT
  49. };
  50. enum SpacingMode {
  51. SPACINGMODE_LENGTH = 0,
  52. SPACINGMODE_FIXED,
  53. SPACINGMODE_PERCENT
  54. };
  55. enum RotateMode {
  56. ROTATEMODE_TANGENT = 0,
  57. ROTATEMODE_CHAIN,
  58. ROTATEMODE_CHAINSCALE
  59. };
  60. Array get_bones();
  61. Ref<SpineSlotData> get_target();
  62. void set_target(Ref<SpineSlotData> v);
  63. PositionMode get_position_mode();
  64. void set_position_mode(PositionMode v);
  65. SpacingMode get_spacing_mode();
  66. void set_spacing_mode(SpacingMode v);
  67. RotateMode get_rotate_mode();
  68. void set_rotate_mode(RotateMode v);
  69. float get_offset_rotation();
  70. void set_offset_rotation(float v);
  71. float get_position();
  72. void set_position(float v);
  73. float get_spacing();
  74. void set_spacing(float v);
  75. float get_mix_rotate();
  76. void set_mix_rotate(float v);
  77. float get_mix_x();
  78. void set_mix_x(float v);
  79. float get_mix_y();
  80. void set_mix_y(float v);
  81. };
  82. VARIANT_ENUM_CAST(SpinePathConstraintData::PositionMode);
  83. VARIANT_ENUM_CAST(SpinePathConstraintData::SpacingMode);
  84. VARIANT_ENUM_CAST(SpinePathConstraintData::RotateMode);
  85. #endif //GODOT_SPINEPATHCONSTRAINTDATA_H