123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- /******************************************************************************
- * Spine Runtimes License Agreement
- * Last updated April 5, 2025. Replaces all prior versions.
- *
- * Copyright (c) 2013-2025, Esoteric Software LLC
- *
- * Integration of the Spine Runtimes into software or otherwise creating
- * derivative works of the Spine Runtimes is permitted under the terms and
- * conditions of Section 2 of the Spine Editor License Agreement:
- * http://esotericsoftware.com/spine-editor-license
- *
- * Otherwise, it is permitted to integrate the Spine Runtimes into software
- * or otherwise create derivative works of the Spine Runtimes (collectively,
- * "Products"), provided that each user of the Products must obtain their own
- * Spine Editor license and redistribution of the Products in any form must
- * include this license and copyright notice.
- *
- * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
- * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *****************************************************************************/
- #pragma once
- #ifndef SPINE_GODOT_EXTENSION
- #include "SpineSprite.h"
- #include "scene/animation/animation_player.h"
- #include "scene/resources/animation.h"
- class SpineAnimationTrack : public Node {
- GDCLASS(SpineAnimationTrack, Node)
- protected:
- // These are not exposed in the inspector, see SpineAnimationTrackInspectorPlugin.
- // Instead, they are are keyed by the animations created in setup_animation_player
- // and primarily used for animation player editor support like scrubbing and playing
- // back the .
- String animation_name;
- bool loop;
- bool animation_changed;
- // These can be set by the user.
- int track_index;
- float mix_duration;
- bool hold_previous;
- bool reverse;
- bool shortest_rotation;
- float time_scale;
- float alpha;
- float mix_attachment_threshold;
- float mix_draw_order_threshold;
- SpineConstant::MixBlend mix_blend;
- bool blend_tree_mode;
- bool debug;
- SpineSprite *sprite;
- static void _bind_methods();
- void _notification(int what);
- AnimationPlayer *find_animation_player();
- void setup_animation_player();
- static Ref<Animation> create_animation(spine::Animation *animation, bool loop);
- void update_animation_state(const Variant &variant_sprite);
- public:
- SpineAnimationTrack();
- void set_animation_name(const String &_animation_name);
- String get_animation_name();
- void set_animation_time(float _animation_time);
- float get_animation_time();
- void set_loop(bool _loop);
- bool get_loop();
- void set_track_index(int _track_index);
- int get_track_index();
- void set_mix_duration(float _mix_duration);
- float get_mix_duration();
- void set_hold_previous(bool _hold_previous);
- bool get_hold_previous();
- void set_reverse(bool _reverse);
- bool get_reverse();
- void set_shortest_rotation(bool _shortest_rotation);
- bool get_shortest_rotation();
- void set_time_scale(float _time_scale);
- float get_time_scale();
- void set_alpha(float _alpha);
- float get_alpha();
- void set_mix_attachment_threshold(float _mix_attachment_threshold);
- float get_mix_attachment_threshold();
- void set_mix_draw_order_threshold(float _mix_draw_order_threshold);
- float get_mix_draw_order_threshold();
- void set_mix_blend(SpineConstant::MixBlend _blend);
- SpineConstant::MixBlend get_mix_blend();
- void set_blend_tree_mode(bool _blend_tree_mode);
- bool get_blend_tree_mode();
- void set_debug(bool _debug);
- bool get_debug();
- };
- #endif
|