Display BitField[Enum] in docs to distinguish from Enum

This commit is contained in:
Danil Alexeev 2023-06-15 17:06:22 +03:00
parent 824820d73a
commit eb391d3302
No known key found for this signature in database
GPG key ID: 124453E157DA8DC7
52 changed files with 191 additions and 129 deletions

View file

@ -51,6 +51,7 @@ void DocData::return_doc_from_retinfo(DocData::MethodDoc &p_method, const Proper
if (p_method.return_enum.begins_with("_")) { //proxy class
p_method.return_enum = p_method.return_enum.substr(1, p_method.return_enum.length());
}
p_method.return_is_bitfield = p_retinfo.usage & PROPERTY_USAGE_CLASS_IS_BITFIELD;
p_method.return_type = "int";
} else if (p_retinfo.class_name != StringName()) {
p_method.return_type = p_retinfo.class_name;
@ -82,6 +83,7 @@ void DocData::argument_doc_from_arginfo(DocData::ArgumentDoc &p_argument, const
if (p_argument.enumeration.begins_with("_")) { //proxy class
p_argument.enumeration = p_argument.enumeration.substr(1, p_argument.enumeration.length());
}
p_argument.is_bitfield = p_arginfo.usage & PROPERTY_USAGE_CLASS_IS_BITFIELD;
p_argument.type = "int";
} else if (p_arginfo.class_name != StringName()) {
p_argument.type = p_arginfo.class_name;

View file

@ -50,6 +50,7 @@ public:
String name;
String type;
String enumeration;
bool is_bitfield = false;
String default_value;
bool operator<(const ArgumentDoc &p_arg) const {
if (name == p_arg.name) {
@ -70,6 +71,9 @@ public:
if (p_dict.has("enumeration")) {
doc.enumeration = p_dict["enumeration"];
if (p_dict.has("is_bitfield")) {
doc.is_bitfield = p_dict["is_bitfield"];
}
}
if (p_dict.has("default_value")) {
@ -91,6 +95,7 @@ public:
if (!p_doc.enumeration.is_empty()) {
dict["enumeration"] = p_doc.enumeration;
dict["is_bitfield"] = p_doc.is_bitfield;
}
if (!p_doc.default_value.is_empty()) {
@ -105,6 +110,7 @@ public:
String name;
String return_type;
String return_enum;
bool return_is_bitfield = false;
String qualifiers;
String description;
bool is_deprecated = false;
@ -152,6 +158,9 @@ public:
if (p_dict.has("return_enum")) {
doc.return_enum = p_dict["return_enum"];
if (p_dict.has("return_is_bitfield")) {
doc.return_is_bitfield = p_dict["return_is_bitfield"];
}
}
if (p_dict.has("qualifiers")) {
@ -201,6 +210,7 @@ public:
if (!p_doc.return_enum.is_empty()) {
dict["return_enum"] = p_doc.return_enum;
dict["return_is_bitfield"] = p_doc.return_is_bitfield;
}
if (!p_doc.qualifiers.is_empty()) {
@ -264,10 +274,9 @@ public:
if (p_dict.has("enumeration")) {
doc.enumeration = p_dict["enumeration"];
}
if (p_dict.has("is_bitfield")) {
doc.is_bitfield = p_dict["is_bitfield"];
if (p_dict.has("is_bitfield")) {
doc.is_bitfield = p_dict["is_bitfield"];
}
}
if (p_dict.has("description")) {
@ -299,10 +308,9 @@ public:
if (!p_doc.enumeration.is_empty()) {
dict["enumeration"] = p_doc.enumeration;
dict["is_bitfield"] = p_doc.is_bitfield;
}
dict["is_bitfield"] = p_doc.is_bitfield;
if (!p_doc.description.is_empty()) {
dict["description"] = p_doc.description;
}
@ -319,6 +327,7 @@ public:
String name;
String type;
String enumeration;
bool is_bitfield = false;
String description;
String setter, getter;
String default_value;
@ -342,6 +351,9 @@ public:
if (p_dict.has("enumeration")) {
doc.enumeration = p_dict["enumeration"];
if (p_dict.has("is_bitfield")) {
doc.is_bitfield = p_dict["is_bitfield"];
}
}
if (p_dict.has("description")) {
@ -391,6 +403,7 @@ public:
if (!p_doc.enumeration.is_empty()) {
dict["enumeration"] = p_doc.enumeration;
dict["is_bitfield"] = p_doc.is_bitfield;
}
if (!p_doc.description.is_empty()) {

View file

@ -35,8 +35,6 @@
#include "core/templates/hash_map.h"
#include "core/variant/typed_array.h"
VARIANT_ENUM_CAST(IP::ResolverStatus);
/************* RESOLVER ******************/
struct _IP_ResolverPrivate {

View file

@ -109,5 +109,6 @@ public:
};
VARIANT_ENUM_CAST(IP::Type);
VARIANT_ENUM_CAST(IP::ResolverStatus);
#endif // IP_H

View file

@ -34,8 +34,6 @@
//#define DEBUG_XML
VARIANT_ENUM_CAST(XMLParser::NodeType);
static inline bool _is_white_space(char c) {
return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
}

View file

@ -126,4 +126,6 @@ public:
~XMLParser();
};
VARIANT_ENUM_CAST(XMLParser::NodeType);
#endif // XML_PARSER_H

View file

@ -52,9 +52,6 @@ static const uint8_t MONTH_DAYS_TABLE[2][12] = {
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
VARIANT_ENUM_CAST(Month);
VARIANT_ENUM_CAST(Weekday);
#define UNIX_TIME_TO_HMS \
uint8_t hour, minute, second; \
{ \

View file

@ -81,4 +81,7 @@ public:
virtual ~Time();
};
VARIANT_ENUM_CAST(Month);
VARIANT_ENUM_CAST(Weekday);
#endif // TIME_H

View file

@ -33,6 +33,7 @@
</xs:sequence>
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="param" maxOccurs="unbounded" minOccurs="0">
@ -44,6 +45,7 @@
<xs:attribute type="xs:string" name="name" />
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
</xs:complexType>
</xs:element>
@ -69,6 +71,7 @@
</xs:sequence>
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="returns_error" maxOccurs="unbounded" minOccurs="0">
@ -88,6 +91,7 @@
<xs:attribute type="xs:string" name="name" />
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
</xs:complexType>
</xs:element>
@ -115,6 +119,7 @@
<xs:attribute type="xs:string" name="getter" />
<xs:attribute type="xs:string" name="overrides" use="optional" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
<xs:attribute type="xs:boolean" name="is_deprecated" use="optional" />
<xs:attribute type="xs:boolean" name="is_experimental" use="optional" />
@ -182,6 +187,7 @@
</xs:sequence>
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="param" maxOccurs="unbounded" minOccurs="0">
@ -193,6 +199,7 @@
<xs:attribute type="xs:string" name="name" />
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
</xs:complexType>
</xs:element>
@ -236,6 +243,7 @@
</xs:sequence>
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="param" maxOccurs="unbounded" minOccurs="0">
@ -247,6 +255,7 @@
<xs:attribute type="xs:string" name="name" />
<xs:attribute type="xs:string" name="type" />
<xs:attribute type="xs:string" name="enum" use="optional" />
<xs:attribute type="xs:boolean" name="is_bitfield" use="optional" />
<xs:attribute type="xs:string" name="default" use="optional" />
</xs:complexType>
</xs:element>

View file

@ -65,7 +65,7 @@
<param index="1" name="arrays" type="Array" />
<param index="2" name="blend_shapes" type="Array[]" default="[]" />
<param index="3" name="lods" type="Dictionary" default="{}" />
<param index="4" name="flags" type="int" enum="Mesh.ArrayFormat" default="0" />
<param index="4" name="flags" type="int" enum="Mesh.ArrayFormat" is_bitfield="true" default="0" />
<description>
Creates a new surface. [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
Surfaces are created to be rendered using a [param primitive], which may be any of the values defined in [enum Mesh.PrimitiveType].
@ -145,7 +145,7 @@
</description>
</method>
<method name="surface_get_format" qualifiers="const">
<return type="int" enum="Mesh.ArrayFormat" />
<return type="int" enum="Mesh.ArrayFormat" is_bitfield="true" />
<param index="0" name="surf_idx" type="int" />
<description>
Returns the format mask of the requested surface (see [method add_surface_from_arrays]).

View file

@ -51,7 +51,7 @@
The [ButtonGroup] associated with the button. Not to be confused with node groups.
[b]Note:[/b] The button will be configured as a radio button if a [ButtonGroup] is assigned to it.
</member>
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButtonMask" default="1">
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButtonMask" is_bitfield="true" default="1">
Binary mask to choose which mouse buttons this button will respond to.
To allow both left-click and right-click, use [code]MOUSE_BUTTON_MASK_LEFT | MOUSE_BUTTON_MASK_RIGHT[/code].
</member>

View file

@ -193,8 +193,8 @@
<param index="5" name="font_size" type="int" default="16" />
<param index="6" name="max_lines" type="int" default="-1" />
<param index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="8" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="9" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="8" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<param index="9" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="10" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -212,8 +212,8 @@
<param index="6" name="max_lines" type="int" default="-1" />
<param index="7" name="size" type="int" default="1" />
<param index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="9" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="10" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="9" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<param index="10" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="11" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="12" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -309,7 +309,7 @@
<param index="4" name="width" type="float" default="-1" />
<param index="5" name="font_size" type="int" default="16" />
<param index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="7" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="7" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="8" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -346,7 +346,7 @@
<param index="5" name="font_size" type="int" default="16" />
<param index="6" name="size" type="int" default="1" />
<param index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="8" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="8" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="9" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>

View file

@ -1028,13 +1028,13 @@
<member name="size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)">
The size of the node's bounding rectangle, in the node's coordinate system. [Container] nodes update this property automatically.
</member>
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" enum="Control.SizeFlags" default="1">
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" enum="Control.SizeFlags" is_bitfield="true" default="1">
Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
</member>
<member name="size_flags_stretch_ratio" type="float" setter="set_stretch_ratio" getter="get_stretch_ratio" default="1.0">
If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" enum="Control.SizeFlags" default="1">
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" enum="Control.SizeFlags" is_bitfield="true" default="1">
Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
</member>
<member name="theme" type="Theme" setter="set_theme" getter="get_theme">

View file

@ -807,7 +807,7 @@
</description>
</method>
<method name="mouse_get_button_state" qualifiers="const">
<return type="int" enum="MouseButtonMask" />
<return type="int" enum="MouseButtonMask" is_bitfield="true" />
<description>
Returns the current state of mouse buttons (whether each button is pressed) as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to [method Input.get_mouse_button_mask].
</description>

View file

@ -60,7 +60,7 @@
<param index="2" name="name" type="String" />
<param index="3" name="hint_type" type="int" enum="PropertyHint" />
<param index="4" name="hint_string" type="String" />
<param index="5" name="usage_flags" type="int" enum="PropertyUsageFlags" />
<param index="5" name="usage_flags" type="int" enum="PropertyUsageFlags" is_bitfield="true" />
<param index="6" name="wide" type="bool" />
<description>
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.

View file

@ -22,7 +22,7 @@
<member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false">
If [code]true[/code], the slider can't be interacted with.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="1" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="1" />
<member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" />
<member name="suffix" type="String" setter="set_suffix" getter="get_suffix" default="&quot;&quot;">
The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed.

View file

@ -44,8 +44,8 @@
<param index="5" name="font_size" type="int" default="16" />
<param index="6" name="max_lines" type="int" default="-1" />
<param index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="8" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="9" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="8" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<param index="9" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="10" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -64,8 +64,8 @@
<param index="6" name="max_lines" type="int" default="-1" />
<param index="7" name="size" type="int" default="1" />
<param index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="9" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="10" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="9" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<param index="10" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="11" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="12" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -82,7 +82,7 @@
<param index="4" name="width" type="float" default="-1" />
<param index="5" name="font_size" type="int" default="16" />
<param index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="7" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="7" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="8" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -100,7 +100,7 @@
<param index="5" name="font_size" type="int" default="16" />
<param index="6" name="size" type="int" default="1" />
<param index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="8" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="8" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="9" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -168,7 +168,7 @@
</description>
</method>
<method name="get_font_style" qualifiers="const">
<return type="int" enum="TextServer.FontStyle" />
<return type="int" enum="TextServer.FontStyle" is_bitfield="true" />
<description>
Returns font style flags, see [enum TextServer.FontStyle].
</description>
@ -200,8 +200,8 @@
<param index="2" name="width" type="float" default="-1" />
<param index="3" name="font_size" type="int" default="16" />
<param index="4" name="max_lines" type="int" default="-1" />
<param index="5" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="6" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="5" name="brk_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<param index="6" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="7" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="8" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>
@ -240,7 +240,7 @@
<param index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" />
<param index="2" name="width" type="float" default="-1" />
<param index="3" name="font_size" type="int" default="16" />
<param index="4" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="4" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<param index="5" name="direction" type="int" enum="TextServer.Direction" default="0" />
<param index="6" name="orientation" type="int" enum="TextServer.Orientation" default="0" />
<description>

View file

@ -580,7 +580,7 @@
<member name="font_stretch" type="int" setter="set_font_stretch" getter="get_font_stretch" default="100">
Font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code].
</member>
<member name="font_style" type="int" setter="set_font_style" getter="get_font_style" enum="TextServer.FontStyle" default="0">
<member name="font_style" type="int" setter="set_font_style" getter="get_font_style" enum="TextServer.FontStyle" is_bitfield="true" default="0">
Font style flags, see [enum TextServer.FontStyle].
</member>
<member name="font_weight" type="int" setter="set_font_weight" getter="get_font_weight" default="400">

View file

@ -20,7 +20,7 @@
<return type="int" enum="Error" />
<param index="0" name="image" type="Image" />
<param index="1" name="fileaccess" type="FileAccess" />
<param index="2" name="flags" type="int" enum="ImageFormatLoader.LoaderFlags" />
<param index="2" name="flags" type="int" enum="ImageFormatLoader.LoaderFlags" is_bitfield="true" />
<param index="3" name="scale" type="float" />
<description>
Loads the content of [param fileaccess] into the provided [param image].

View file

@ -156,7 +156,7 @@
</description>
</method>
<method name="get_mouse_button_mask" qualifiers="const">
<return type="int" enum="MouseButtonMask" />
<return type="int" enum="MouseButtonMask" is_bitfield="true" />
<description>
Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to [method DisplayServer.mouse_get_button_state].
</description>

View file

@ -10,7 +10,7 @@
<link title="Using InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link>
</tutorials>
<members>
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButtonMask" default="0">
<member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask" enum="MouseButtonMask" is_bitfield="true" default="0">
The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks.
</member>
<member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" default="Vector2(0, 0)">

View file

@ -11,7 +11,7 @@
</tutorials>
<methods>
<method name="get_modifiers_mask" qualifiers="const">
<return type="int" enum="KeyModifierMask" />
<return type="int" enum="KeyModifierMask" is_bitfield="true" />
<description>
Returns the keycode combination of modifier keys.
</description>

View file

@ -48,7 +48,7 @@
<member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" default="163">
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
</member>
<member name="label_settings" type="LabelSettings" setter="set_label_settings" getter="get_label_settings">
@ -64,7 +64,7 @@
Limits the lines of text the node shows on screen.
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" overrides="Control" enum="Control.MouseFilter" default="2" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="4" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="4" />
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="TextServer.StructuredTextParser" default="0">
Set BiDi algorithm override for the structured text.
</member>

View file

@ -71,7 +71,7 @@
<member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="1">
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" default="163">
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">

View file

@ -184,7 +184,7 @@
<member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="100.0">
The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
</member>
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters2D.PathMetadataFlags" default="7">
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters2D.PathMetadataFlags" is_bitfield="true" default="7">
Additional information to return with the navigation path.
</member>
<member name="path_postprocessing" type="int" setter="set_path_postprocessing" getter="get_path_postprocessing" enum="NavigationPathQueryParameters2D.PathPostProcessing" default="0">

View file

@ -187,7 +187,7 @@
<member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="5.0">
The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
</member>
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters3D.PathMetadataFlags" default="7">
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters3D.PathMetadataFlags" is_bitfield="true" default="7">
Additional information to return with the navigation path.
</member>
<member name="path_postprocessing" type="int" setter="set_path_postprocessing" getter="get_path_postprocessing" enum="NavigationPathQueryParameters3D.PathPostProcessing" default="0">

View file

@ -13,7 +13,7 @@
<member name="map" type="RID" setter="set_map" getter="get_map">
The navigation [code]map[/code] [RID] used in the path query.
</member>
<member name="metadata_flags" type="int" setter="set_metadata_flags" getter="get_metadata_flags" enum="NavigationPathQueryParameters2D.PathMetadataFlags" default="7">
<member name="metadata_flags" type="int" setter="set_metadata_flags" getter="get_metadata_flags" enum="NavigationPathQueryParameters2D.PathMetadataFlags" is_bitfield="true" default="7">
Additional information to include with the navigation path.
</member>
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">

View file

@ -13,7 +13,7 @@
<member name="map" type="RID" setter="set_map" getter="get_map">
The navigation [code]map[/code] [RID] used in the path query.
</member>
<member name="metadata_flags" type="int" setter="set_metadata_flags" getter="get_metadata_flags" enum="NavigationPathQueryParameters3D.PathMetadataFlags" default="7">
<member name="metadata_flags" type="int" setter="set_metadata_flags" getter="get_metadata_flags" enum="NavigationPathQueryParameters3D.PathMetadataFlags" is_bitfield="true" default="7">
Additional information to include with the navigation path.
</member>
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">

View file

@ -877,7 +877,7 @@
<member name="process_thread_group_order" type="int" setter="set_process_thread_group_order" getter="get_process_thread_group_order">
Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example.
</member>
<member name="process_thread_messages" type="int" setter="set_process_thread_messages" getter="get_process_thread_messages" enum="Node.ProcessThreadMessages">
<member name="process_thread_messages" type="int" setter="set_process_thread_messages" getter="get_process_thread_messages" enum="Node.ProcessThreadMessages" is_bitfield="true">
Set whether the current thread group will process messages (calls to [method call_deferred_thread_group] on threads, and whether it wants to receive them during regular process or physics process callbacks.
</member>
<member name="scene_file_path" type="String" setter="set_scene_file_path" getter="get_scene_file_path">
@ -1115,11 +1115,11 @@
<constant name="PROCESS_THREAD_GROUP_SUB_THREAD" value="2" enum="ProcessThreadGroup">
Process this node (and children nodes set to inherit) on a sub-thread. See [member process_thread_group] for more information.
</constant>
<constant name="FLAG_PROCESS_THREAD_MESSAGES" value="1" enum="ProcessThreadMessages">
<constant name="FLAG_PROCESS_THREAD_MESSAGES" value="1" enum="ProcessThreadMessages" is_bitfield="true">
</constant>
<constant name="FLAG_PROCESS_THREAD_MESSAGES_PHYSICS" value="2" enum="ProcessThreadMessages">
<constant name="FLAG_PROCESS_THREAD_MESSAGES_PHYSICS" value="2" enum="ProcessThreadMessages" is_bitfield="true">
</constant>
<constant name="FLAG_PROCESS_THREAD_MESSAGES_ALL" value="3" enum="ProcessThreadMessages">
<constant name="FLAG_PROCESS_THREAD_MESSAGES_ALL" value="3" enum="ProcessThreadMessages" is_bitfield="true">
</constant>
<constant name="DUPLICATE_SIGNALS" value="1" enum="DuplicateFlags">
Duplicate the node's signals.

View file

@ -44,7 +44,7 @@
<member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="RenderingDevice.TextureType" default="1">
The texture type.
</member>
<member name="usage_bits" type="int" setter="set_usage_bits" getter="get_usage_bits" enum="RenderingDevice.TextureUsageBits" default="0">
<member name="usage_bits" type="int" setter="set_usage_bits" getter="get_usage_bits" enum="RenderingDevice.TextureUsageBits" is_bitfield="true" default="0">
The texture's usage bits, which determine what can be done using the texture.
</member>
<member name="width" type="int" setter="set_width" getter="get_width" default="1">

View file

@ -62,7 +62,7 @@
<member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values" default="false">
If [code]true[/code], [member value] will always be rounded to the nearest integer.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="0" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="0" />
<member name="step" type="float" setter="set_step" getter="get_step" default="0.01">
If greater than 0, [member value] will always be rounded to a multiple of this property's value. If [member rounded] is also [code]true[/code], [member value] will first be rounded to a multiple of this property's value, then rounded to the nearest integer.
</member>

View file

@ -16,8 +16,8 @@
<methods>
<method name="barrier">
<return type="void" />
<param index="0" name="from" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="1" name="to" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="0" name="from" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<param index="1" name="to" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Puts a memory barrier in place. This is used for synchronization to avoid data races. See also [method full_barrier], which may be useful for debugging.
</description>
@ -27,7 +27,7 @@
<param index="0" name="buffer" type="RID" />
<param index="1" name="offset" type="int" />
<param index="2" name="size_bytes" type="int" />
<param index="3" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="3" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
</description>
</method>
@ -46,7 +46,7 @@
<param index="1" name="offset" type="int" />
<param index="2" name="size_bytes" type="int" />
<param index="3" name="data" type="PackedByteArray" />
<param index="4" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="4" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
</description>
</method>
@ -114,7 +114,7 @@
</method>
<method name="compute_list_end">
<return type="void" />
<param index="0" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="0" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Finishes a list of compute commands created with the [code]compute_*[/code] methods.
</description>
@ -296,7 +296,7 @@
</method>
<method name="draw_list_end">
<return type="void" />
<param index="0" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="0" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Finishes a list of raster drawing commands created with the [code]draw_*[/code] methods.
</description>
@ -534,7 +534,7 @@
<param index="5" name="multisample_state" type="RDPipelineMultisampleState" />
<param index="6" name="stencil_state" type="RDPipelineDepthStencilState" />
<param index="7" name="color_blend_state" type="RDPipelineColorBlendState" />
<param index="8" name="dynamic_state_flags" type="int" enum="RenderingDevice.PipelineDynamicStateFlags" default="0" />
<param index="8" name="dynamic_state_flags" type="int" enum="RenderingDevice.PipelineDynamicStateFlags" is_bitfield="true" default="0" />
<param index="9" name="for_render_pass" type="int" default="0" />
<param index="10" name="specialization_constants" type="RDPipelineSpecializationConstant[]" default="[]" />
<description>
@ -643,7 +643,7 @@
<return type="RID" />
<param index="0" name="size_bytes" type="int" />
<param index="1" name="data" type="PackedByteArray" default="PackedByteArray()" />
<param index="2" name="usage" type="int" enum="RenderingDevice.StorageBufferUsage" default="0" />
<param index="2" name="usage" type="int" enum="RenderingDevice.StorageBufferUsage" is_bitfield="true" default="0" />
<description>
Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffer[/url] with the specified [param data] and [param usage]. It can be accessed with the RID that is returned.
Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method.
@ -682,7 +682,7 @@
<param index="3" name="mipmap_count" type="int" />
<param index="4" name="base_layer" type="int" />
<param index="5" name="layer_count" type="int" />
<param index="6" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="6" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Clears the specified [param texture] by replacing all of its pixels with the specified [param color]. [param base_mipmap] and [param mipmap_count] determine which mipmaps of the texture are affected by this clear operation, while [param base_layer] and [param layer_count] determine which layers of a 3D texture (or texture array) are affected by this clear operation. For 2D textures (which only have one layer by design), [param base_layer] and [param layer_count] must both be [code]0[/code].
[b]Note:[/b] [param texture] can't be cleared while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to clear this texture.
@ -699,7 +699,7 @@
<param index="6" name="dst_mipmap" type="int" />
<param index="7" name="src_layer" type="int" />
<param index="8" name="dst_layer" type="int" />
<param index="9" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="9" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Copies the [param from_texture] to [param to_texture] with the specified [param from_pos], [param to_pos] and [param size] coordinates. The Z axis of the [param from_pos], [param to_pos] and [param size] must be [code]0[/code] for 2-dimensional textures. Source and destination mipmaps/layers must also be specified, with these parameters being [code]0[/code] for textures without mipmaps or single-layer textures. Returns [constant @GlobalScope.OK] if the texture copy was successful or [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise.
[b]Note:[/b] [param from_texture] texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture.
@ -763,7 +763,7 @@
<method name="texture_is_format_supported_for_usage" qualifiers="const">
<return type="bool" />
<param index="0" name="format" type="int" enum="RenderingDevice.DataFormat" />
<param index="1" name="usage_flags" type="int" enum="RenderingDevice.TextureUsageBits" />
<param index="1" name="usage_flags" type="int" enum="RenderingDevice.TextureUsageBits" is_bitfield="true" />
<description>
Returns [code]true[/code] if the specified [param format] is supported for the given [param usage_flags], [code]false[/code] otherwise.
</description>
@ -786,7 +786,7 @@
<return type="int" enum="Error" />
<param index="0" name="from_texture" type="RID" />
<param index="1" name="to_texture" type="RID" />
<param index="2" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="2" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Resolves the [param from_texture] texture onto [param to_texture] with multisample antialiasing enabled. This must be used when rendering a framebuffer for MSAA to work. Returns [constant @GlobalScope.OK] if successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise.
[b]Note:[/b] [param from_texture] and [param to_texture] textures must have the same dimension, format and type (color or depth).
@ -803,7 +803,7 @@
<param index="0" name="texture" type="RID" />
<param index="1" name="layer" type="int" />
<param index="2" name="data" type="PackedByteArray" />
<param index="3" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" default="7" />
<param index="3" name="post_barrier" type="int" enum="RenderingDevice.BarrierMask" is_bitfield="true" default="7" />
<description>
Updates texture data with new data, replacing the previous data in place. The updated texture data must have the same dimensions and format. For 2D textures (which only have one layer), [param layer] must be [code]0[/code]. Returns [constant @GlobalScope.OK] if the update was successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise.
[b]Note:[/b] Updating textures is forbidden during creation of a draw or compute list.

View file

@ -2096,7 +2096,7 @@
<param index="2" name="arrays" type="Array" />
<param index="3" name="blend_shapes" type="Array" default="[]" />
<param index="4" name="lods" type="Dictionary" default="{}" />
<param index="5" name="compress_format" type="int" enum="RenderingServer.ArrayFormat" default="0" />
<param index="5" name="compress_format" type="int" enum="RenderingServer.ArrayFormat" is_bitfield="true" default="0" />
<description>
</description>
</method>
@ -2199,14 +2199,14 @@
</method>
<method name="mesh_surface_get_format_attribute_stride" qualifiers="const">
<return type="int" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" is_bitfield="true" />
<param index="1" name="vertex_count" type="int" />
<description>
</description>
</method>
<method name="mesh_surface_get_format_offset" qualifiers="const">
<return type="int" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" is_bitfield="true" />
<param index="1" name="vertex_count" type="int" />
<param index="2" name="array_index" type="int" />
<description>
@ -2214,14 +2214,14 @@
</method>
<method name="mesh_surface_get_format_skin_stride" qualifiers="const">
<return type="int" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" is_bitfield="true" />
<param index="1" name="vertex_count" type="int" />
<description>
</description>
</method>
<method name="mesh_surface_get_format_vertex_stride" qualifiers="const">
<return type="int" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" />
<param index="0" name="format" type="int" enum="RenderingServer.ArrayFormat" is_bitfield="true" />
<param index="1" name="vertex_count" type="int" />
<description>
</description>

View file

@ -37,7 +37,7 @@
<return type="int" enum="Error" />
<param index="0" name="resource" type="Resource" />
<param index="1" name="path" type="String" default="&quot;&quot;" />
<param index="2" name="flags" type="int" enum="ResourceSaver.SaverFlags" default="0" />
<param index="2" name="flags" type="int" enum="ResourceSaver.SaverFlags" is_bitfield="true" default="0" />
<description>
Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. If [param path] is empty, [ResourceSaver] will try to use [member Resource.resource_path].
The [param flags] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags.

View file

@ -410,7 +410,7 @@
<param index="1" name="base_direction" type="int" enum="Control.TextDirection" default="0" />
<param index="2" name="language" type="String" default="&quot;&quot;" />
<param index="3" name="st_parser" type="int" enum="TextServer.StructuredTextParser" default="0" />
<param index="4" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="163" />
<param index="4" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="163" />
<param index="5" name="tab_stops" type="PackedFloat32Array" default="PackedFloat32Array()" />
<description>
Adds a [code][p][/code] tag to the tag stack.

View file

@ -60,7 +60,7 @@
<member name="select_all_on_focus" type="bool" setter="set_select_all_on_focus" getter="is_select_all_on_focus" default="false">
If [code]true[/code], the [SpinBox] will select the whole text when the [LineEdit] gains focus. Clicking the up and down arrows won't trigger this behavior.
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="1" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="1" />
<member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" />
<member name="suffix" type="String" setter="set_suffix" getter="get_suffix" default="&quot;&quot;">
Adds the specified [code]suffix[/code] string after the numerical value of the [SpinBox].

View file

@ -151,7 +151,7 @@
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
Text writing direction.
</member>
<member name="flags" type="int" setter="set_flags" getter="get_flags" enum="TextServer.JustificationFlag" default="3">
<member name="flags" type="int" setter="set_flags" getter="get_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="3">
Line alignment rules. For more info see [TextServer].
</member>
<member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0">

View file

@ -29,7 +29,7 @@
<member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="1">
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" default="163">
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">

View file

@ -265,7 +265,7 @@
<member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="HorizontalAlignment" default="0">
Paragraph horizontal alignment.
</member>
<member name="break_flags" type="int" setter="set_break_flags" getter="get_break_flags" enum="TextServer.LineBreakFlag" default="3">
<member name="break_flags" type="int" setter="set_break_flags" getter="get_break_flags" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3">
Line breaking rules. For more info see [TextServer].
</member>
<member name="custom_punctuation" type="String" setter="set_custom_punctuation" getter="get_custom_punctuation" default="&quot;&quot;">
@ -274,7 +274,7 @@
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
Text writing direction.
</member>
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" default="163">
<member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163">
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
</member>
<member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible" default="-1">

View file

@ -386,7 +386,7 @@
</description>
</method>
<method name="font_get_style" qualifiers="const">
<return type="int" enum="TextServer.FontStyle" />
<return type="int" enum="TextServer.FontStyle" is_bitfield="true" />
<param index="0" name="font_rid" type="RID" />
<description>
Returns font style flags, see [enum FontStyle].
@ -840,7 +840,7 @@
<method name="font_set_style">
<return type="void" />
<param index="0" name="font_rid" type="RID" />
<param index="1" name="style" type="int" enum="TextServer.FontStyle" />
<param index="1" name="style" type="int" enum="TextServer.FontStyle" is_bitfield="true" />
<description>
Sets the font style flags, see [enum FontStyle].
[b]Note:[/b] This value is used for font matching only and will not affect font rendering. Use [method font_set_face_index], [method font_set_variation_coordinates], [method font_set_embolden], or [method font_set_transform] instead.
@ -1168,7 +1168,7 @@
<return type="float" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="width" type="float" />
<param index="2" name="justification_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<param index="2" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" default="3" />
<description>
Adjusts text width to fit to specified width, returns new text width.
</description>
@ -1275,7 +1275,7 @@
<param index="0" name="shaped" type="RID" />
<param index="1" name="width" type="float" />
<param index="2" name="start" type="int" default="0" />
<param index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<description>
Breaks text to the lines and returns character ranges for each line.
</description>
@ -1286,7 +1286,7 @@
<param index="1" name="width" type="PackedFloat32Array" />
<param index="2" name="start" type="int" default="0" />
<param index="3" name="once" type="bool" default="true" />
<param index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" default="3" />
<param index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" default="3" />
<description>
Breaks text to the lines and columns. Returns character ranges for each segment.
</description>
@ -1397,7 +1397,7 @@
<method name="shaped_text_get_word_breaks" qualifiers="const">
<return type="PackedInt32Array" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" default="264" />
<param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" is_bitfield="true" default="264" />
<description>
Breaks text into words and returns array of character ranges. Use [param grapheme_flags] to set what characters are used for breaking (see [enum GraphemeFlag]).
</description>
@ -1444,7 +1444,7 @@
<return type="void" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="width" type="float" default="0" />
<param index="2" name="overrun_trim_flags" type="int" enum="TextServer.TextOverrunFlag" default="0" />
<param index="2" name="overrun_trim_flags" type="int" enum="TextServer.TextOverrunFlag" is_bitfield="true" default="0" />
<description>
Trims text if it exceeds the given width.
</description>

View file

@ -332,7 +332,7 @@
</description>
</method>
<method name="_font_get_style" qualifiers="virtual const">
<return type="int" enum="TextServer.FontStyle" />
<return type="int" enum="TextServer.FontStyle" is_bitfield="true" />
<param index="0" name="font_rid" type="RID" />
<description>
</description>
@ -734,7 +734,7 @@
<method name="_font_set_style" qualifiers="virtual">
<return type="void" />
<param index="0" name="font_rid" type="RID" />
<param index="1" name="style" type="int" enum="TextServer.FontStyle" />
<param index="1" name="style" type="int" enum="TextServer.FontStyle" is_bitfield="true" />
<description>
</description>
</method>
@ -1008,7 +1008,7 @@
<return type="float" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="width" type="float" />
<param index="2" name="justification_flags" type="int" enum="TextServer.JustificationFlag" />
<param index="2" name="justification_flags" type="int" enum="TextServer.JustificationFlag" is_bitfield="true" />
<description>
</description>
</method>
@ -1100,7 +1100,7 @@
<param index="0" name="shaped" type="RID" />
<param index="1" name="width" type="float" />
<param index="2" name="start" type="int" />
<param index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" />
<param index="3" name="break_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" />
<description>
</description>
</method>
@ -1110,7 +1110,7 @@
<param index="1" name="width" type="PackedFloat32Array" />
<param index="2" name="start" type="int" />
<param index="3" name="once" type="bool" />
<param index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" />
<param index="4" name="break_flags" type="int" enum="TextServer.LineBreakFlag" is_bitfield="true" />
<description>
</description>
</method>
@ -1205,7 +1205,7 @@
<method name="_shaped_text_get_word_breaks" qualifiers="virtual const">
<return type="PackedInt32Array" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" />
<param index="1" name="grapheme_flags" type="int" enum="TextServer.GraphemeFlag" is_bitfield="true" />
<description>
</description>
</method>
@ -1240,7 +1240,7 @@
<return type="void" />
<param index="0" name="shaped" type="RID" />
<param index="1" name="width" type="float" />
<param index="2" name="trim_flags" type="int" enum="TextServer.TextOverrunFlag" />
<param index="2" name="trim_flags" type="int" enum="TextServer.TextOverrunFlag" is_bitfield="true" />
<description>
</description>
</method>

View file

@ -43,7 +43,7 @@
<member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle" default="0.0">
Starting angle for the fill of [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. When the node's [code]value[/code] is equal to its [code]min_value[/code], the texture doesn't show up at all. When the [code]value[/code] increases, the texture fills and tends towards [member radial_fill_degrees].
</member>
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="1" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="1" />
<member name="step" type="float" setter="set_step" getter="get_step" overrides="Range" default="1.0" />
<member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin" default="0">
The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders.

View file

@ -9,8 +9,8 @@
<tutorials>
</tutorials>
<members>
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" overrides="Control" enum="Control.SizeFlags" default="0" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="1" />
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="0" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="1" />
</members>
<theme_items>
<theme_item name="decrement" data_type="icon" type="Texture2D">

View file

@ -9,8 +9,8 @@
<tutorials>
</tutorials>
<members>
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" overrides="Control" enum="Control.SizeFlags" default="0" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" default="1" />
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="0" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="1" />
</members>
<theme_items>
<theme_item name="center_grabber" data_type="constant" type="int" default="0">

View file

@ -27,7 +27,7 @@ MARKUP_ALLOWED_SUBSEQUENT = " -.,:;!?\\/'\")]}>"
# Used to translate section headings and other hardcoded strings when required with
# the --lang argument. The BASE_STRINGS list should be synced with what we actually
# write in this script (check `translate()` uses), and also hardcoded in
# `doc/translations/extract.py` to include them in the source POT file.
# `scripts/extract_classes.py` (godotengine/godot-editor-l10n repo) to include them in the source POT file.
BASE_STRINGS = [
"All classes",
"Globals",
@ -65,6 +65,7 @@ BASE_STRINGS = [
"This method is used to construct a type.",
"This method doesn't need an instance to be called, so it can be called directly using the class name.",
"This method describes a valid operator to use with this type as left-hand operand.",
"This value is an integer composed as a bitmask of the following flags.",
]
strings_l10n: Dict[str, str] = {}
@ -362,13 +363,14 @@ class State:
class TypeName:
def __init__(self, type_name: str, enum: Optional[str] = None) -> None:
def __init__(self, type_name: str, enum: Optional[str] = None, is_bitfield: bool = False) -> None:
self.type_name = type_name
self.enum = enum
self.is_bitfield = is_bitfield
def to_rst(self, state: State) -> str:
if self.enum is not None:
return make_enum(self.enum, state)
return make_enum(self.enum, self.is_bitfield, state)
elif self.type_name == "void":
return "void"
else:
@ -376,7 +378,7 @@ class TypeName:
@classmethod
def from_element(cls, element: ET.Element) -> "TypeName":
return cls(element.attrib["type"], element.get("enum"))
return cls(element.attrib["type"], element.get("enum"), element.get("is_bitfield") == "true")
class DefinitionBase:
@ -1280,7 +1282,7 @@ def make_type(klass: str, state: State) -> str:
return klass
def make_enum(t: str, state: State) -> str:
def make_enum(t: str, is_bitfield: bool, state: State) -> str:
p = t.find(".")
if p >= 0:
c = t[0:p]
@ -1296,7 +1298,12 @@ def make_enum(t: str, state: State) -> str:
c = "@GlobalScope"
if c in state.classes and e in state.classes[c].enums:
return f":ref:`{e}<enum_{c}_{e}>`"
if is_bitfield:
if not state.classes[c].enums[e].is_bitfield:
print_error(f'{state.current_class}.xml: Enum "{t}" is not bitfield.', state)
return f"|bitfield|\<:ref:`{e}<enum_{c}_{e}>`\>"
else:
return f":ref:`{e}<enum_{c}_{e}>`"
# Don't fail for `Vector3.Axis`, as this enum is a special case which is expected not to be resolved.
if f"{c}.{e}" != "Vector3.Axis":
@ -1412,6 +1419,7 @@ def make_footer() -> str:
"This method doesn't need an instance to be called, so it can be called directly using the class name."
)
operator_msg = translate("This method describes a valid operator to use with this type as left-hand operand.")
bitfield_msg = translate("This value is an integer composed as a bitmask of the following flags.")
return (
f".. |virtual| replace:: :abbr:`virtual ({virtual_msg})`\n"
@ -1420,6 +1428,7 @@ def make_footer() -> str:
f".. |constructor| replace:: :abbr:`constructor ({constructor_msg})`\n"
f".. |static| replace:: :abbr:`static ({static_msg})`\n"
f".. |operator| replace:: :abbr:`operator ({operator_msg})`\n"
f".. |bitfield| replace:: :abbr:`BitField ({bitfield_msg})`\n"
)
@ -1834,7 +1843,7 @@ def format_text_block(
escape_post = True
elif cmd.startswith("enum"):
tag_text = make_enum(link_target, state)
tag_text = make_enum(link_target, False, state)
escape_pre = True
escape_post = True

View file

@ -502,6 +502,7 @@ void DocTools::generate(bool p_basic_types) {
found_type = true;
if (retinfo.type == Variant::INT && retinfo.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) {
prop.enumeration = retinfo.class_name;
prop.is_bitfield = retinfo.usage & PROPERTY_USAGE_CLASS_IS_BITFIELD;
prop.type = "int";
} else if (retinfo.class_name != StringName()) {
prop.type = retinfo.class_name;
@ -1065,6 +1066,9 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> &
method.return_type = parser->get_named_attribute_value("type");
if (parser->has_attribute("enum")) {
method.return_enum = parser->get_named_attribute_value("enum");
if (parser->has_attribute("is_bitfield")) {
method.return_is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
}
}
} else if (name == "returns_error") {
ERR_FAIL_COND_V(!parser->has_attribute("number"), ERR_FILE_CORRUPT);
@ -1077,6 +1081,9 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> &
argument.type = parser->get_named_attribute_value("type");
if (parser->has_attribute("enum")) {
argument.enumeration = parser->get_named_attribute_value("enum");
if (parser->has_attribute("is_bitfield")) {
argument.is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
}
}
method.arguments.push_back(argument);
@ -1267,6 +1274,9 @@ Error DocTools::_load(Ref<XMLParser> parser) {
}
if (parser->has_attribute("enum")) {
prop2.enumeration = parser->get_named_attribute_value("enum");
if (parser->has_attribute("is_bitfield")) {
prop2.is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
}
}
if (parser->has_attribute("is_deprecated")) {
prop2.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
@ -1334,9 +1344,9 @@ Error DocTools::_load(Ref<XMLParser> parser) {
constant2.is_value_valid = true;
if (parser->has_attribute("enum")) {
constant2.enumeration = parser->get_named_attribute_value("enum");
}
if (parser->has_attribute("is_bitfield")) {
constant2.is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
if (parser->has_attribute("is_bitfield")) {
constant2.is_bitfield = parser->get_named_attribute_value("is_bitfield").to_lower() == "true";
}
}
if (parser->has_attribute("is_deprecated")) {
constant2.is_deprecated = parser->get_named_attribute_value("is_deprecated").to_lower() == "true";
@ -1407,6 +1417,9 @@ static void _write_method_doc(Ref<FileAccess> f, const String &p_name, Vector<Do
String enum_text;
if (!m.return_enum.is_empty()) {
enum_text = " enum=\"" + m.return_enum + "\"";
if (m.return_is_bitfield) {
enum_text += " is_bitfield=\"true\"";
}
}
_write_string(f, 3, "<return type=\"" + m.return_type.xml_escape(true) + "\"" + enum_text + " />");
}
@ -1422,6 +1435,9 @@ static void _write_method_doc(Ref<FileAccess> f, const String &p_name, Vector<Do
String enum_text;
if (!a.enumeration.is_empty()) {
enum_text = " enum=\"" + a.enumeration + "\"";
if (a.is_bitfield) {
enum_text += " is_bitfield=\"true\"";
}
}
if (!a.default_value.is_empty()) {
@ -1512,6 +1528,9 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String,
String additional_attributes;
if (!c.properties[i].enumeration.is_empty()) {
additional_attributes += " enum=\"" + c.properties[i].enumeration + "\"";
if (c.properties[i].is_bitfield) {
additional_attributes += " is_bitfield=\"true\"";
}
}
if (!c.properties[i].default_value.is_empty()) {
additional_attributes += " default=\"" + c.properties[i].default_value.xml_escape(true) + "\"";

View file

@ -293,7 +293,7 @@ void EditorHelp::_class_desc_resized(bool p_force_update_theme) {
}
}
void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
void EditorHelp::_add_type(const String &p_type, const String &p_enum, bool p_is_bitfield) {
if (p_type.is_empty() || p_type == "void") {
class_desc->push_color(Color(theme_cache.type_color, 0.5));
class_desc->push_hint(TTR("No return value."));
@ -304,6 +304,7 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
}
bool is_enum_type = !p_enum.is_empty();
bool is_bitfield = p_is_bitfield && is_enum_type;
bool can_ref = !p_type.contains("*") || is_enum_type;
String link_t = p_type; // For links in metadata
@ -327,6 +328,13 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
class_desc->add_text("Array");
class_desc->pop();
class_desc->add_text("[");
} else if (is_bitfield) {
class_desc->push_color(Color(theme_cache.type_color, 0.5));
class_desc->push_hint(TTR("This value is an integer composed as a bitmask of the following flags."));
class_desc->add_text("BitField");
class_desc->pop();
class_desc->add_text("[");
class_desc->pop();
}
if (is_enum_type) {
@ -340,6 +348,10 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
class_desc->pop(); // Pushed meta above.
if (add_array) {
class_desc->add_text("]");
} else if (is_bitfield) {
class_desc->push_color(Color(theme_cache.type_color, 0.5));
class_desc->add_text("]");
class_desc->pop();
}
}
class_desc->pop();
@ -403,7 +415,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
_add_bulletpoint();
}
_add_type(p_method.return_type, p_method.return_enum);
_add_type(p_method.return_type, p_method.return_enum, p_method.return_is_bitfield);
if (p_overview) {
class_desc->pop(); // align
@ -437,7 +449,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
_add_text(p_method.arguments[j].name);
class_desc->add_text(": ");
_add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration);
_add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration, p_method.arguments[j].is_bitfield);
if (!p_method.arguments[j].default_value.is_empty()) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
@ -953,7 +965,7 @@ void EditorHelp::_update_doc() {
class_desc->push_cell();
class_desc->push_paragraph(HORIZONTAL_ALIGNMENT_RIGHT, Control::TEXT_DIRECTION_AUTO, "");
_push_code_font();
_add_type(cd.properties[i].type, cd.properties[i].enumeration);
_add_type(cd.properties[i].type, cd.properties[i].enumeration, cd.properties[i].is_bitfield);
_pop_code_font();
class_desc->pop();
class_desc->pop(); // cell
@ -1252,7 +1264,7 @@ void EditorHelp::_update_doc() {
_add_text(cd.signals[i].arguments[j].name);
class_desc->add_text(": ");
_add_type(cd.signals[i].arguments[j].type, cd.signals[i].arguments[j].enumeration);
_add_type(cd.signals[i].arguments[j].type, cd.signals[i].arguments[j].enumeration, cd.signals[i].arguments[j].is_bitfield);
if (!cd.signals[i].arguments[j].default_value.is_empty()) {
class_desc->push_color(theme_cache.symbol_color);
class_desc->add_text(" = ");
@ -1630,7 +1642,7 @@ void EditorHelp::_update_doc() {
_push_code_font();
_add_bulletpoint();
_add_type(cd.properties[i].type, cd.properties[i].enumeration);
_add_type(cd.properties[i].type, cd.properties[i].enumeration, cd.properties[i].is_bitfield);
class_desc->add_text(" ");
_pop_code_font();
class_desc->pop(); // cell

View file

@ -158,7 +158,7 @@ class EditorHelp : public VBoxContainer {
bool scroll_locked = false;
//void _button_pressed(int p_idx);
void _add_type(const String &p_type, const String &p_enum = String());
void _add_type(const String &p_type, const String &p_enum = String(), bool p_is_bitfield = false);
void _add_type_icon(const String &p_type, int p_size = 0, const String &p_fallback = "");
void _add_method(const DocData::MethodDoc &p_method, bool p_overview = true);

View file

@ -34,11 +34,6 @@
#include "core/math/geometry_2d.h"
#include "line_builder.h"
// Needed so we can bind functions
VARIANT_ENUM_CAST(Line2D::LineJointMode)
VARIANT_ENUM_CAST(Line2D::LineCapMode)
VARIANT_ENUM_CAST(Line2D::LineTextureMode)
Line2D::Line2D() {
}

View file

@ -138,4 +138,9 @@ private:
bool _antialiased = false;
};
// Needed so we can bind functions
VARIANT_ENUM_CAST(Line2D::LineJointMode)
VARIANT_ENUM_CAST(Line2D::LineCapMode)
VARIANT_ENUM_CAST(Line2D::LineTextureMode)
#endif // LINE_2D_H

View file

@ -46,11 +46,6 @@
#include <stdint.h>
VARIANT_ENUM_CAST(Node::ProcessMode);
VARIANT_ENUM_CAST(Node::ProcessThreadGroup);
VARIANT_BITFIELD_CAST(Node::ProcessThreadMessages);
VARIANT_ENUM_CAST(Node::InternalMode);
int Node::orphan_node_count = 0;
thread_local Node *Node::current_process_thread_group = nullptr;
@ -3446,9 +3441,9 @@ void Node::_bind_methods() {
BIND_ENUM_CONSTANT(PROCESS_THREAD_GROUP_MAIN_THREAD);
BIND_ENUM_CONSTANT(PROCESS_THREAD_GROUP_SUB_THREAD);
BIND_ENUM_CONSTANT(FLAG_PROCESS_THREAD_MESSAGES);
BIND_ENUM_CONSTANT(FLAG_PROCESS_THREAD_MESSAGES_PHYSICS);
BIND_ENUM_CONSTANT(FLAG_PROCESS_THREAD_MESSAGES_ALL);
BIND_BITFIELD_FLAG(FLAG_PROCESS_THREAD_MESSAGES);
BIND_BITFIELD_FLAG(FLAG_PROCESS_THREAD_MESSAGES_PHYSICS);
BIND_BITFIELD_FLAG(FLAG_PROCESS_THREAD_MESSAGES_ALL);
BIND_ENUM_CONSTANT(DUPLICATE_SIGNALS);
BIND_ENUM_CONSTANT(DUPLICATE_GROUPS);

View file

@ -711,6 +711,10 @@ public:
};
VARIANT_ENUM_CAST(Node::DuplicateFlags);
VARIANT_ENUM_CAST(Node::ProcessMode);
VARIANT_ENUM_CAST(Node::ProcessThreadGroup);
VARIANT_BITFIELD_CAST(Node::ProcessThreadMessages);
VARIANT_ENUM_CAST(Node::InternalMode);
typedef HashSet<Node *, Node::Comparator> NodeSet;