Skip to content
0.2.0-dev Download ZIP
98 lines ·5.2 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="EditorInspectorPlugin" inherits="RefCounted" api_type="editor" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Plugin for adding custom property editors on the inspector.
5 </brief_description>
6 <description>
7 [EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
8 When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported.
9 If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class.
10 Subsequently, the [method _parse_category] and [method _parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too.
11 Finally, [method _parse_end] will be called.
12 On each of these calls, the "add" functions can be called.
13 To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
14 </description>
15 <tutorials>
16 <link title="Inspector plugins">$DOCS_URL/tutorials/plugins/editor/inspector_plugins.html</link>
17 </tutorials>
18 <methods>
19 <method name="_can_handle" qualifiers="virtual const">
20 <return type="bool" />
21 <param index="0" name="object" type="Object" />
22 <description>
23 Returns [code]true[/code] if this object can be handled by this plugin.
24 </description>
25 </method>
26 <method name="_parse_begin" qualifiers="virtual">
27 <return type="void" />
28 <param index="0" name="object" type="Object" />
29 <description>
30 Called to allow adding controls at the beginning of the property list for [param object].
31 </description>
32 </method>
33 <method name="_parse_category" qualifiers="virtual">
34 <return type="void" />
35 <param index="0" name="object" type="Object" />
36 <param index="1" name="category" type="String" />
37 <description>
38 Called to allow adding controls at the beginning of a category in the property list for [param object].
39 </description>
40 </method>
41 <method name="_parse_end" qualifiers="virtual">
42 <return type="void" />
43 <param index="0" name="object" type="Object" />
44 <description>
45 Called to allow adding controls at the end of the property list for [param object].
46 </description>
47 </method>
48 <method name="_parse_group" qualifiers="virtual">
49 <return type="void" />
50 <param index="0" name="object" type="Object" />
51 <param index="1" name="group" type="String" />
52 <description>
53 Called to allow adding controls at the beginning of a group or a sub-group in the property list for [param object].
54 </description>
55 </method>
56 <method name="_parse_property" qualifiers="virtual">
57 <return type="bool" />
58 <param index="0" name="object" type="Object" />
59 <param index="1" name="type" type="int" enum="Variant.Type" />
60 <param index="2" name="name" type="String" />
61 <param index="3" name="hint_type" type="int" enum="PropertyHint" />
62 <param index="4" name="hint_string" type="String" />
63 <param index="5" name="usage_flags" type="int" enum="PropertyUsageFlags" is_bitfield="true" />
64 <param index="6" name="wide" type="bool" />
65 <description>
66 Called to allow adding property-specific editors to the property list for [param object]. The added editor control must extend [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
67 </description>
68 </method>
69 <method name="add_custom_control">
70 <return type="void" />
71 <param index="0" name="control" type="Control" />
72 <description>
73 Adds a custom control, which is not necessarily a property editor.
74 </description>
75 </method>
76 <method name="add_property_editor">
77 <return type="void" />
78 <param index="0" name="property" type="String" />
79 <param index="1" name="editor" type="Control" />
80 <param index="2" name="add_to_end" type="bool" default="false" />
81 <param index="3" name="label" type="String" default="&quot;&quot;" />
82 <description>
83 Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty].
84 There can be multiple property editors for a property. If [param add_to_end] is [code]true[/code], this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is [code]false[/code]. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor.
85 [param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead.
86 </description>
87 </method>
88 <method name="add_property_editor_for_multiple_properties">
89 <return type="void" />
90 <param index="0" name="label" type="String" />
91 <param index="1" name="properties" type="PackedStringArray" />
92 <param index="2" name="editor" type="Control" />
93 <description>
94 Adds an editor that allows modifying multiple properties. The [param editor] control must extend [EditorProperty].
95 </description>
96 </method>
97 </methods>
98</class>