Skip to content
0.2.0-dev Download ZIP
85 lines ·4.3 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="SkeletonModification2D" inherits="Resource" api_type="core" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Base class for resources that operate on [Bone2D]s in a [Skeleton2D].
5 </brief_description>
6 <description>
7 This resource provides an interface that can be expanded so code that operates on [Bone2D] nodes in a [Skeleton2D] can be mixed and matched together to create complex interactions.
8 This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses.
9 </description>
10 <tutorials>
11 </tutorials>
12 <methods>
13 <method name="_draw_editor_gizmo" qualifiers="virtual">
14 <return type="void" />
15 <description>
16 Used for drawing [b]editor-only[/b] modification gizmos. This function will only be called in the Godot editor and can be overridden to draw custom gizmos.
17 [b]Note:[/b] You will need to use the Skeleton2D from [method SkeletonModificationStack2D.get_skeleton] and its draw functions, as the [SkeletonModification2D] resource cannot draw on its own.
18 </description>
19 </method>
20 <method name="_execute" qualifiers="virtual">
21 <return type="void" />
22 <param index="0" name="delta" type="float" />
23 <description>
24 Executes the given modification. This is where the modification performs whatever function it is designed to do.
25 </description>
26 </method>
27 <method name="_setup_modification" qualifiers="virtual">
28 <return type="void" />
29 <param index="0" name="modification_stack" type="SkeletonModificationStack2D" />
30 <description>
31 Called when the modification is setup. This is where the modification performs initialization.
32 </description>
33 </method>
34 <method name="clamp_angle">
35 <return type="float" />
36 <param index="0" name="angle" type="float" />
37 <param index="1" name="min" type="float" />
38 <param index="2" name="max" type="float" />
39 <param index="3" name="invert" type="bool" />
40 <description>
41 Takes an angle and clamps it so it is within the passed-in [param min] and [param max] range. [param invert] will inversely clamp the angle, clamping it to the range outside of the given bounds.
42 </description>
43 </method>
44 <method name="get_editor_draw_gizmo" qualifiers="const">
45 <return type="bool" />
46 <description>
47 Returns whether this modification will call [method _draw_editor_gizmo] in the Godot editor to draw modification-specific gizmos.
48 </description>
49 </method>
50 <method name="get_is_setup" qualifiers="const">
51 <return type="bool" />
52 <description>
53 Returns whether this modification has been successfully setup or not.
54 </description>
55 </method>
56 <method name="get_modification_stack">
57 <return type="SkeletonModificationStack2D" />
58 <description>
59 Returns the [SkeletonModificationStack2D] that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on.
60 </description>
61 </method>
62 <method name="set_editor_draw_gizmo">
63 <return type="void" />
64 <param index="0" name="draw_gizmo" type="bool" />
65 <description>
66 Sets whether this modification will call [method _draw_editor_gizmo] in the Godot editor to draw modification-specific gizmos.
67 </description>
68 </method>
69 <method name="set_is_setup">
70 <return type="void" />
71 <param index="0" name="is_setup" type="bool" />
72 <description>
73 Manually allows you to set the setup state of the modification. This function should only rarely be used, as the [SkeletonModificationStack2D] the modification is bound to should handle setting the modification up.
74 </description>
75 </method>
76 </methods>
77 <members>
78 <member name="enabled" type="bool" setter="set_enabled" getter="get_enabled" default="true">
79 If [code]true[/code], the modification's [method _execute] function will be called by the [SkeletonModificationStack2D].
80 </member>
81 <member name="execution_mode" type="int" setter="set_execution_mode" getter="get_execution_mode" default="0">
82 The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes.
83 </member>
84 </members>
85</class>