Path: blob/master/scene/resources/2d/skeleton/skeleton_modification_stack_2d.h
9904 views
/**************************************************************************/1/* skeleton_modification_stack_2d.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/io/resource.h"3334///////////////////////////////////////35// SkeletonModificationStack2D36///////////////////////////////////////3738class Skeleton2D;39class SkeletonModification2D;40class Bone2D;4142class SkeletonModificationStack2D : public Resource {43GDCLASS(SkeletonModificationStack2D, Resource);44friend class Skeleton2D;45friend class SkeletonModification2D;4647protected:48static void _bind_methods();49void _get_property_list(List<PropertyInfo> *p_list) const;50bool _set(const StringName &p_path, const Variant &p_value);51bool _get(const StringName &p_path, Variant &r_ret) const;5253public:54Skeleton2D *skeleton = nullptr;55bool is_setup = false;56bool enabled = false;57float strength = 1.0;5859enum EXECUTION_MODE {60execution_mode_process,61execution_mode_physics_process62};6364Vector<Ref<SkeletonModification2D>> modifications;6566void setup();67void execute(float p_delta, int p_execution_mode);6869bool editor_gizmo_dirty = false;70void draw_editor_gizmos();71void set_editor_gizmos_dirty(bool p_dirty);7273void enable_all_modifications(bool p_enable);74Ref<SkeletonModification2D> get_modification(int p_mod_idx) const;75void add_modification(Ref<SkeletonModification2D> p_mod);76void delete_modification(int p_mod_idx);77void set_modification(int p_mod_idx, Ref<SkeletonModification2D> p_mod);7879void set_modification_count(int p_count);80int get_modification_count() const;8182void set_skeleton(Skeleton2D *p_skeleton);83Skeleton2D *get_skeleton() const;8485bool get_is_setup() const;8687void set_enabled(bool p_enabled);88bool get_enabled() const;8990void set_strength(float p_strength);91float get_strength() const;9293SkeletonModificationStack2D();94};959697