diff options
Diffstat (limited to 'doc')
39 files changed, 1693 insertions, 174 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 0334bab32a..5d45947a19 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -23,7 +23,7 @@ Returns the absolute value of float parameter [code]x[/code] (i.e. positive value). [codeblock] # a is 1.2 - a = absf(-1.2) + var a = absf(-1.2) [/codeblock] </description> </method> @@ -34,7 +34,7 @@ Returns the absolute value of int parameter [code]x[/code] (i.e. positive value). [codeblock] # a is 1 - a = absi(-1) + var a = absi(-1) [/codeblock] </description> </method> @@ -45,7 +45,7 @@ Returns the arc cosine of [code]x[/code] in radians. Use to get the angle of cosine [code]x[/code]. [code]x[/code] must be between [code]-1.0[/code] and [code]1.0[/code] (inclusive), otherwise, [method acos] will return [constant @GDScript.NAN]. [codeblock] # c is 0.523599 or 30 degrees if converted with rad2deg(c) - c = acos(0.866025) + var c = acos(0.866025) [/codeblock] </description> </method> @@ -56,7 +56,7 @@ Returns the arc sine of [code]x[/code] in radians. Use to get the angle of sine [code]x[/code]. [code]x[/code] must be between [code]-1.0[/code] and [code]1.0[/code] (inclusive), otherwise, [method asin] will return [constant @GDScript.NAN]. [codeblock] # s is 0.523599 or 30 degrees if converted with rad2deg(s) - s = asin(0.5) + var s = asin(0.5) [/codeblock] </description> </method> @@ -64,11 +64,12 @@ <return type="float" /> <argument index="0" name="x" type="float" /> <description> - Returns the arc tangent of [code]x[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry: [code]atan(tan(angle)) == angle[/code]. + Returns the arc tangent of [code]x[/code] in radians. Use it to get the angle from an angle's tangent in trigonometry. The method cannot know in which quadrant the angle should fall. See [method atan2] if you have both [code]y[/code] and [code]x[/code]. [codeblock] - a = atan(0.5) # a is 0.463648 + var a = atan(0.5) # a is 0.463648 [/codeblock] + If [code]x[/code] is between [code]-PI / 2[/code] and [code]PI / 2[/code] (inclusive), [code]atan(tan(x))[/code] is equal to [code]x[/code]. </description> </method> <method name="atan2"> @@ -79,7 +80,7 @@ Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle of tangent [code]y/x[/code]. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. Important note: The Y coordinate comes first, by convention. [codeblock] - a = atan2(0, -1) # a is 3.141593 + var a = atan2(0, -1) # a is 3.141593 [/codeblock] </description> </method> @@ -105,8 +106,8 @@ <description> Rounds [code]x[/code] upward (towards positive infinity), returning the smallest whole number that is not less than [code]x[/code]. [codeblock] - i = ceil(1.45) # i is 2 - i = ceil(1.001) # i is 2 + var i = ceil(1.45) # i is 2.0 + i = ceil(1.001) # i is 2.0 [/codeblock] See also [method floor], [method round], and [method snapped]. </description> @@ -127,9 +128,9 @@ <description> Clamps the float [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code]. [codeblock] - speed = 42.1 + var speed = 42.1 # a is 20.0 - a = clampf(speed, 1.0, 20.0) + var a = clampf(speed, 1.0, 20.0) speed = -10.0 # a is -1.0 @@ -145,9 +146,9 @@ <description> Clamps the integer [code]value[/code] and returns a value not less than [code]min[/code] and not more than [code]max[/code]. [codeblock] - speed = 42 + var speed = 42 # a is 20 - a = clampi(speed, 1, 20) + var a = clampi(speed, 1, 20) speed = -10 # a is -1 @@ -161,9 +162,9 @@ <description> Returns the cosine of angle [code]angle_rad[/code] in radians. [codeblock] - # Prints 1 then -1 - print(cos(PI * 2)) - print(cos(PI)) + cos(PI * 2) # Returns 1.0 + cos(PI) # Returns -1.0 + cos(deg2rad(90)) # Returns 0.0 [/codeblock] </description> </method> @@ -192,7 +193,7 @@ Converts an angle expressed in degrees to radians. [codeblock] # r is 3.141593 - r = deg2rad(180) + var r = deg2rad(180) [/codeblock] </description> </method> @@ -201,7 +202,18 @@ <argument index="0" name="x" type="float" /> <argument index="1" name="curve" type="float" /> <description> - Easing function, based on exponent. The curve values are: 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. + Returns an "eased" value of [code]x[/code] based on an easing function defined with [code]curve[/code]. This easing function is based on an exponent. The [code]curve[/code] can be any floating-point number, with specific values leading to the following behaviors: + [codeblock] + - Lower than -1.0 (exclusive): Ease in-out + - 1.0: Linear + - Between -1.0 and 0.0 (exclusive): Ease out-in + - 0.0: Constant + - Between 0.0 to 1.0 (exclusive): Ease in + - 1.0: Linear + - Greater than 1.0 (exclusive): Ease out + [/codeblock] + [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/ease_cheatsheet.png]ease() curve values cheatsheet[/url] + See also [method smoothstep]. If you need to perform more advanced transitions, use [Tween] or [AnimationPlayer]. </description> </method> <method name="error_string"> @@ -219,7 +231,7 @@ [b]e[/b] has an approximate value of 2.71828, and can be obtained with [code]exp(1)[/code]. For exponents to other bases use the method [method pow]. [codeblock] - a = exp(2) # Approximately 7.39 + var a = exp(2) # Approximately 7.39 [/codeblock] </description> </method> @@ -230,7 +242,7 @@ Rounds [code]x[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]x[/code]. [codeblock] # a is 2.0 - a = floor(2.99) + var a = floor(2.99) # a is -3.0 a = floor(-2.99) [/codeblock] @@ -550,7 +562,7 @@ <description> Converts one or more arguments of any type to string in the best way possible and prints them to the console. [codeblock] - a = [1, 2, 3] + var a = [1, 2, 3] print("a", "b", a) # Prints ab[1, 2, 3] [/codeblock] [b]Note:[/b] Consider using [method push_error] and [method push_warning] to print error and warning messages instead of [method print]. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. @@ -729,7 +741,7 @@ <description> Sets seed for the random number generator. [codeblock] - my_seed = "Godot Rocks" + var my_seed = "Godot Rocks" seed(my_seed.hash()) [/codeblock] </description> @@ -770,7 +782,8 @@ <description> Returns the sine of angle [code]angle_rad[/code] in radians. [codeblock] - sin(0.523599) # Returns 0.5 + sin(0.523599) # Returns 0.5 + sin(deg2rad(90)) # Returns 1.0 [/codeblock] </description> </method> @@ -780,7 +793,7 @@ <description> Returns the hyperbolic sine of [code]x[/code]. [codeblock] - a = log(2.0) # Returns 0.693147 + var a = log(2.0) # Returns 0.693147 sinh(a) # Returns 0.75 [/codeblock] </description> @@ -800,6 +813,8 @@ smoothstep(0, 2, 1.0) # Returns 0.5 smoothstep(0, 2, 2.0) # Returns 1.0 [/codeblock] + Compared to [method ease] with a curve value of [code]-1.6521[/code], [method smoothstep] returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use [Tween] or [AnimationPlayer]. + [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_ease_comparison.png]Comparison between smoothstep() and ease(x, -1.6521) return values[/url] </description> </method> <method name="snapped"> @@ -833,7 +848,7 @@ Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. [codeblock] # n is 0 - n = step_decimals(5) + var n = step_decimals(5) # n is 4 n = step_decimals(1.0005) # n is 9 @@ -853,8 +868,8 @@ <description> Converts a formatted string that was returned by [method var2str] to the original value. [codeblock] - a = '{ "a": 1, "b": 2 }' - b = str2var(a) + var a = '{ "a": 1, "b": 2 }' + var b = str2var(a) print(b["a"]) # Prints 1 [/codeblock] </description> @@ -875,7 +890,7 @@ <description> Returns the hyperbolic tangent of [code]x[/code]. [codeblock] - a = log(2.0) # Returns 0.693147 + var a = log(2.0) # Returns 0.693147 tanh(a) # Returns 0.6 [/codeblock] </description> @@ -2473,16 +2488,16 @@ <constant name="RPC_MODE_DISABLED" value="0" enum="RPCMode"> Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods. </constant> - <constant name="RPC_MODE_ANY" value="1" enum="RPCMode"> + <constant name="RPC_MODE_ANY_PEER" value="1" enum="RPCMode"> Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not. </constant> <constant name="RPC_MODE_AUTH" value="2" enum="RPCMode"> Used with [method Node.rpc_config] to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the [code]@rpc(auth)[/code] annotation. See [method Node.set_multiplayer_authority]. </constant> <constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode"> - Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_ORDERED]. Use for non-critical data, and always consider whether the order matters. + Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters. </constant> - <constant name="TRANSFER_MODE_ORDERED" value="1" enum="TransferMode"> + <constant name="TRANSFER_MODE_UNRELIABLE_ORDERED" value="1" enum="TransferMode"> Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [constant TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data. </constant> <constant name="TRANSFER_MODE_RELIABLE" value="2" enum="TransferMode"> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index a5516636aa..84ed0de42d 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -250,7 +250,8 @@ The strength of the normal map's effect. </member> <member name="normal_texture" type="Texture2D" setter="set_texture" getter="get_texture"> - Texture used to specify the normal at a given pixel. The [code]normal_texture[/code] only uses the red and green channels. The normal read from [code]normal_texture[/code] is oriented around the surface normal provided by the [Mesh]. + Texture used to specify the normal at a given pixel. The [code]normal_texture[/code] only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [code]normal_texture[/code] is oriented around the surface normal provided by the [Mesh]. + [b]Note:[/b] The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with [SurfaceTool], you can use [method SurfaceTool.generate_normals] and [method SurfaceTool.generate_tangents] to automatically generate normals and tangents respectively. [b]Note:[/b] Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. </member> <member name="orm_texture" type="Texture2D" setter="set_texture" getter="get_texture"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 501f89fa0d..738594ea5d 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -150,7 +150,7 @@ <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <argument index="8" name="outline_size" type="int" default="0" /> <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="51" /> + <argument index="10" name="flags" type="int" default="99" /> <description> Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. </description> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index 35702070be..e14c2dc110 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -28,6 +28,12 @@ Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. </description> </method> + <method name="get_last_motion" qualifiers="const"> + <return type="Vector2" /> + <description> + Returns the last motion applied to the [CharacterBody2D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. + </description> + </method> <method name="get_last_slide_collision"> <return type="KinematicCollision2D" /> <description> @@ -40,6 +46,18 @@ Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. </description> </method> + <method name="get_position_delta" qualifiers="const"> + <return type="Vector2" /> + <description> + Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. + </description> + </method> + <method name="get_real_velocity" qualifiers="const"> + <return type="Vector2" /> + <description> + Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member motion_velocity] which returns the requested velocity. + </description> + </method> <method name="get_slide_collision"> <return type="KinematicCollision2D" /> <argument index="0" name="slide_idx" type="int" /> @@ -68,6 +86,12 @@ Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. </description> </method> + <method name="get_wall_normal" qualifiers="const"> + <return type="Vector2" /> + <description> + Returns the surface normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns [code]true[/code]. + </description> + </method> <method name="is_on_ceiling" qualifiers="const"> <return type="bool" /> <description> @@ -107,9 +131,9 @@ <method name="move_and_slide"> <return type="bool" /> <description> - Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidDynamicBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + Moves the body based on [member motion_velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidDynamicBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. - Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. + Modifies [member motion_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. The general behaviour and available properties change according to the [member motion_mode]. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. @@ -138,20 +162,24 @@ As long as the snapping vector is in contact with the ground and the body moves against `up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along `up_direction`, so it will be able to detach from the ground when jumping. </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> - If [code]true[/code], the body will not slide on floor's slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. + If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. + If [code]false[/code], the body will slide on floor's slopes when [member motion_velocity] applies a downward force. </member> <member name="free_mode_min_slide_angle" type="float" setter="set_free_mode_min_slide_angle" getter="get_free_mode_min_slide_angle" default="0.261799"> Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. </member> - <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> - Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. - </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. </member> <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody2D.MotionMode" default="0"> Sets the motion mode which defines the behaviour of [method move_and_slide]. See [enum MotionMode] constants for available modes. </member> + <member name="motion_velocity" type="Vector2" setter="set_motion_velocity" getter="get_motion_velocity" default="Vector2(0, 0)"> + Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. + </member> + <member name="moving_platform_apply_velocity_on_leave" type="int" setter="set_moving_platform_apply_velocity_on_leave" getter="get_moving_platform_apply_velocity_on_leave" enum="CharacterBody2D.MovingPlatformApplyVelocityOnLeave" default="0"> + Sets the behaviour to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum MovingPlatformApplyVelocityOnLeave] constants for available behaviour. + </member> <member name="moving_platform_floor_layers" type="int" setter="set_moving_platform_floor_layers" getter="get_moving_platform_floor_layers" default="4294967295"> Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all floor bodies are detected and propagate their velocity. </member> @@ -172,5 +200,14 @@ <constant name="MOTION_MODE_FREE" value="1" enum="MotionMode"> Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will always be constant. This mode is suitable for top-down games. </constant> + <constant name="PLATFORM_VEL_ON_LEAVE_ALWAYS" value="0" enum="MovingPlatformApplyVelocityOnLeave"> + Add the last platform velocity to the [member motion_velocity] when you leave a moving platform. + </constant> + <constant name="PLATFORM_VEL_ON_LEAVE_UPWARD_ONLY" value="1" enum="MovingPlatformApplyVelocityOnLeave"> + Add the last platform velocity to the [member motion_velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. + </constant> + <constant name="PLATFORM_VEL_ON_LEAVE_NEVER" value="2" enum="MovingPlatformApplyVelocityOnLeave"> + Do nothing when leaving a platform. + </constant> </constants> </class> diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 66d9940b60..24b26fb16e 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -32,7 +32,7 @@ <method name="get_last_motion" qualifiers="const"> <return type="Vector3" /> <description> - Returns the last motion applied to the [CharacterBody3D] during the last call to [method move_and_slide]. The movement can be split if needed into multiple motion, this method return the last one, it's useful to retrieve the current direction of the movement. + Returns the last motion applied to the [CharacterBody3D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. </description> </method> <method name="get_last_slide_collision"> @@ -56,7 +56,7 @@ <method name="get_real_velocity" qualifiers="const"> <return type="Vector3" /> <description> - Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member linear_velocity] which returns the requested velocity. + Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member motion_velocity] which returns the requested velocity. </description> </method> <method name="get_slide_collision"> @@ -117,9 +117,9 @@ <method name="move_and_slide"> <return type="bool" /> <description> - Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidDynamicBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + Moves the body based on [member motion_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidDynamicBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. - Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. + Modifies [member motion_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> @@ -147,10 +147,8 @@ As long as the snapping vector is in contact with the ground and the body moves against `up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along `up_direction`, so it will be able to detach from the ground when jumping. </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> - If [code]true[/code], the body will not slide on slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. - </member> - <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> - Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. + If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. + If [code]false[/code], the body will slide on floor's slopes when [member motion_velocity] applies a downward force. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="6"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. @@ -158,6 +156,9 @@ <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody3D.MotionMode" default="0"> Sets the motion mode which defines the behaviour of [method move_and_slide]. See [enum MotionMode] constants for available modes. </member> + <member name="motion_velocity" type="Vector3" setter="set_motion_velocity" getter="get_motion_velocity" default="Vector3(0, 0, 0)"> + Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. + </member> <member name="moving_platform_apply_velocity_on_leave" type="int" setter="set_moving_platform_apply_velocity_on_leave" getter="get_moving_platform_apply_velocity_on_leave" enum="CharacterBody3D.MovingPlatformApplyVelocityOnLeave" default="0"> Sets the behaviour to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum MovingPlatformApplyVelocityOnLeave] constants for available behaviour. </member> @@ -185,10 +186,10 @@ Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will always be constant. This mode is suitable for games without ground like space games. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_ALWAYS" value="0" enum="MovingPlatformApplyVelocityOnLeave"> - Add the last platform velocity to the [member linear_velocity] when you leave a moving platform. + Add the last platform velocity to the [member motion_velocity] when you leave a moving platform. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_UPWARD_ONLY" value="1" enum="MovingPlatformApplyVelocityOnLeave"> - Add the last platform velocity to the [member linear_velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. + Add the last platform velocity to the [member motion_velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. </constant> <constant name="PLATFORM_VEL_ON_LEAVE_NEVER" value="2" enum="MovingPlatformApplyVelocityOnLeave"> Do nothing when leaving a platform. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index c9a2de66a8..b00bf1c250 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -742,10 +742,10 @@ </method> <method name="set_drag_forwarding"> <return type="void" /> - <argument index="0" name="target" type="Control" /> + <argument index="0" name="target" type="Node" /> <description> - Forwards the handling of this control's drag and drop to [code]target[/code] control. - Forwarding can be implemented in the target control similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences: + Forwards the handling of this control's drag and drop to [code]target[/code] node. + Forwarding can be implemented in the target node similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences: 1. The function name must be suffixed with [b]_fw[/b] 2. The function must take an extra argument that is the control doing the forwarding [codeblocks] diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 0575ea3eef..adc1eab393 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -40,7 +40,7 @@ }; [/csharp] [/codeblocks] - You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). + You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). [codeblocks] [gdscript] export(string, "White", "Yellow", "Orange") var my_color @@ -72,7 +72,7 @@ my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. [/gdscript] [csharp] - var myDir = new Godot.Collections.Dictionary + var myDict = new Godot.Collections.Dictionary { {"First Array", new Godot.Collections.Array{1, 2, 3, 4}} }; @@ -85,7 +85,7 @@ points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. [/gdscript] [csharp] - var pointsDir = new Godot.Collections.Dictionary + var pointsDict = new Godot.Collections.Dictionary { {"White", 50}, {"Yellow", 75}, @@ -98,7 +98,7 @@ [codeblocks] [gdscript] # This is a valid dictionary. - # To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`. + # To access the string "Nested value" below, use `my_dict.sub_dict.sub_key` or `my_dict["sub_dict"]["sub_key"]`. # Indexing styles can be mixed and matched depending on your needs. var my_dict = { "String Key": 5, @@ -109,8 +109,7 @@ [/gdscript] [csharp] // This is a valid dictionary. - // To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`. - // Indexing styles can be mixed and matched depending on your needs. + // To access the string "Nested value" below, use `((Godot.Collections.Dictionary)myDict["sub_dict"])["sub_key"]`. var myDict = new Godot.Collections.Dictionary { {"String Key", 5}, {4, new Godot.Collections.Array{1,2,3}}, @@ -213,7 +212,8 @@ <return type="bool" /> <argument index="0" name="key" type="Variant" /> <description> - Erase a dictionary key/value pair by key. Returns [code]true[/code] if the given key was present in the dictionary, [code]false[/code] otherwise. Does not erase elements while iterating over the dictionary. + Erase a dictionary key/value pair by key. Returns [code]true[/code] if the given key was present in the dictionary, [code]false[/code] otherwise. + [b]Note:[/b] Don't erase elements while iterating over the dictionary. You can iterate over the [method keys] array instead. </description> </method> <method name="get" qualifiers="const"> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 4f495eaec9..7eff8db59c 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -276,6 +276,14 @@ [b]Note:[/b] This method is implemented on Linux, macOS and Windows. </description> </method> + <method name="keyboard_get_keycode_from_physical" qualifiers="const"> + <return type="int" enum="Key" /> + <argument index="0" name="keycode" type="int" enum="Key" /> + <description> + Converts a physical (US QWERTY) [code]keycode[/code] to one in the active keyboard layout. + [b]Note:[/b] This method is implemented on Linux, macOS and Windows. + </description> + </method> <method name="keyboard_get_layout_count" qualifiers="const"> <return type="int" /> <description> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index e8ff0f60ec..39881e9eb7 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -103,7 +103,7 @@ <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <argument index="8" name="outline_size" type="int" default="0" /> <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="51" /> + <argument index="10" name="flags" type="int" default="99" /> <description> Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_multiline_string]. @@ -185,7 +185,7 @@ <argument index="0" name="text" type="String" /> <argument index="1" name="width" type="float" default="-1" /> <argument index="2" name="size" type="int" default="-1" /> - <argument index="3" name="flags" type="int" default="48" /> + <argument index="3" name="flags" type="int" default="96" /> <description> Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account. See also [method draw_multiline_string]. diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index c558c541ad..29fc4700fd 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -25,9 +25,6 @@ <member name="collider_id" type="int" setter="" getter="get_collider_id" default="0"> The colliding body's unique instance ID. See [method Object.get_instance_id]. </member> - <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata"> - The colliding body's metadata. See [Object]. - </member> <member name="collider_rid" type="RID" setter="" getter="get_collider_rid"> The colliding body's [RID] used by the [PhysicsServer2D]. </member> diff --git a/doc/classes/KinematicCollision3D.xml b/doc/classes/KinematicCollision3D.xml index db32cf57bc..3db6fe019b 100644 --- a/doc/classes/KinematicCollision3D.xml +++ b/doc/classes/KinematicCollision3D.xml @@ -32,13 +32,6 @@ Returns the collider ID by index (the latest by default). </description> </method> - <method name="get_collider_metadata" qualifiers="const"> - <return type="Variant" /> - <argument index="0" name="collision_index" type="int" default="0" /> - <description> - Returns the collider metadata by index (the latest by default). - </description> - </method> <method name="get_collider_rid" qualifiers="const"> <return type="RID" /> <argument index="0" name="collision_index" type="int" default="0" /> @@ -96,9 +89,6 @@ <member name="collider_id" type="int" setter="" getter="get_best_collider_id" default="0"> The colliding body's unique instance ID. See [method Object.get_instance_id]. </member> - <member name="collider_metadata" type="Variant" setter="" getter="get_best_collider_metadata"> - The colliding body's metadata. See [Object]. - </member> <member name="collider_rid" type="RID" setter="" getter="get_best_collider_rid"> The colliding body's [RID] used by the [PhysicsServer3D]. </member> diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml index 15517f7c2f..67d3161aba 100644 --- a/doc/classes/MultiplayerPeer.xml +++ b/doc/classes/MultiplayerPeer.xml @@ -58,7 +58,7 @@ </member> <member name="transfer_channel" type="int" setter="set_transfer_channel" getter="get_transfer_channel" default="0"> The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the creation of multiple independent channels which behaves, in a way, like separate connections. This means that reliable data will only block delivery of other packets on that channel, and ordering will only be in respect to the channel the packet is being sent on. Using different channels to send [b]different and independent[/b] state updates is a common way to optimize network usage and decrease latency in fast-paced games. - [b]Note:[/b] The default channel ([code]0[/code]) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. + [b]Note:[/b] The default channel ([code]0[/code]) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. </member> <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" enum="TransferMode" default="2"> The manner in which to send packets to the [code]target_peer[/code]. See [enum TransferMode]. diff --git a/doc/classes/MultiplayerPeerExtension.xml b/doc/classes/MultiplayerPeerExtension.xml index d9c173a4a1..46f9b22758 100644 --- a/doc/classes/MultiplayerPeerExtension.xml +++ b/doc/classes/MultiplayerPeerExtension.xml @@ -24,7 +24,7 @@ </method> <method name="_get_packet" qualifiers="virtual"> <return type="int" /> - <argument index="0" name="r_buffer" type="const void*" /> + <argument index="0" name="r_buffer" type="const uint8_t **" /> <argument index="1" name="r_buffer_size" type="int32_t*" /> <description> </description> @@ -66,7 +66,7 @@ </method> <method name="_put_packet" qualifiers="virtual"> <return type="int" /> - <argument index="0" name="p_buffer" type="const void*" /> + <argument index="0" name="p_buffer" type="const uint8_t*" /> <argument index="1" name="p_buffer_size" type="int" /> <description> </description> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 608d76cd9f..b4edcf49f4 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -700,9 +700,6 @@ <member name="custom_multiplayer" type="MultiplayerAPI" setter="set_custom_multiplayer" getter="get_custom_multiplayer"> The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one. </member> - <member name="filename" type="String" setter="set_filename" getter="get_filename"> - When a scene is instantiated from a file, its topmost node contains the filename from which it was loaded. - </member> <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree). </member> @@ -719,6 +716,9 @@ <member name="process_priority" type="int" setter="set_process_priority" getter="get_process_priority" default="0"> The node's priority in the execution order of the enabled processing callbacks (i.e. [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS] and their internal counterparts). Nodes whose process priority value is [i]lower[/i] will have their processing callbacks executed first. </member> + <member name="scene_file_path" type="String" setter="set_scene_file_path" getter="get_scene_file_path"> + If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in [member scene_file_path] (e.g. [code]res://levels/1.tscn[/code]). Otherwise, [member scene_file_path] is set to an empty string. + </member> </members> <signals> <signal name="ready"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 9d0d185c42..656fa61af7 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -246,7 +246,7 @@ <method name="get_name" qualifiers="const"> <return type="String" /> <description> - Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"OSX"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code]. + Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"macOS"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code]. </description> </method> <method name="get_process_id" qualifiers="const"> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 8e94254a1f..39733baf40 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -43,6 +43,15 @@ Appends a [PackedByteArray] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="compress" qualifiers="const"> <return type="PackedByteArray" /> <argument index="0" name="compression_mode" type="int" default="0" /> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index 4bccdcd939..00e670646d 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -43,6 +43,15 @@ Appends a [PackedColorArray] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="Color" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedColorArray" /> <description> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 51e14ea3d4..2ee2ac44df 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -44,6 +44,15 @@ Appends a [PackedFloat32Array] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedFloat32Array" /> <description> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 25c9c025f7..7414bc72fc 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -44,6 +44,15 @@ Appends a [PackedFloat64Array] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedFloat64Array" /> <description> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 1a61ce0ead..8ecf4a70ae 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -44,6 +44,15 @@ Appends a [PackedInt32Array] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedInt32Array" /> <description> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index 06f7900237..b82ce79009 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -44,6 +44,15 @@ Appends a [PackedInt64Array] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="int" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedInt64Array" /> <description> diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index 763ed0cc55..353bbfb827 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -44,6 +44,15 @@ Appends a [PackedStringArray] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="String" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedStringArray" /> <description> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index 3f0797bb59..7b7df221e7 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -44,6 +44,15 @@ Appends a [PackedVector2Array] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="Vector2" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedVector2Array" /> <description> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index 6b950cad61..efbf2169fd 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -43,6 +43,15 @@ Appends a [PackedVector3Array] at the end of this array. </description> </method> + <method name="bsearch"> + <return type="int" /> + <argument index="0" name="value" type="Vector3" /> + <argument index="1" name="before" type="bool" default="true" /> + <description> + Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a [code]before[/code] specifier can be passed. If [code]false[/code], the returned index comes after all existing entries of the value in the array. + [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. + </description> + </method> <method name="duplicate"> <return type="PackedVector3Array" /> <description> diff --git a/doc/classes/PacketPeerExtension.xml b/doc/classes/PacketPeerExtension.xml index 6804053484..f6b925eb30 100644 --- a/doc/classes/PacketPeerExtension.xml +++ b/doc/classes/PacketPeerExtension.xml @@ -19,14 +19,14 @@ </method> <method name="_get_packet" qualifiers="virtual"> <return type="int" /> - <argument index="0" name="r_buffer" type="const void*" /> + <argument index="0" name="r_buffer" type="const uint8_t **" /> <argument index="1" name="r_buffer_size" type="int32_t*" /> <description> </description> </method> <method name="_put_packet" qualifiers="virtual"> <return type="int" /> - <argument index="0" name="p_buffer" type="const void*" /> + <argument index="0" name="p_buffer" type="const uint8_t*" /> <argument index="1" name="p_buffer_size" type="int" /> <description> </description> diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml index bbb708c9b4..aa189f17f4 100644 --- a/doc/classes/PhysicsDirectBodyState2D.xml +++ b/doc/classes/PhysicsDirectBodyState2D.xml @@ -90,13 +90,6 @@ Returns the collider's shape index. </description> </method> - <method name="get_contact_collider_shape_metadata" qualifiers="const"> - <return type="Variant" /> - <argument index="0" name="contact_idx" type="int" /> - <description> - Returns the collided shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data]. - </description> - </method> <method name="get_contact_collider_velocity_at_position" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="contact_idx" type="int" /> diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml index 0264249dab..9aa00022cd 100644 --- a/doc/classes/PhysicsDirectSpaceState2D.xml +++ b/doc/classes/PhysicsDirectSpaceState2D.xml @@ -36,7 +36,6 @@ [b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object. The returned object is a dictionary containing the following fields: [code]collider_id[/code]: The colliding object's ID. [code]linear_velocity[/code]: The colliding object's velocity [Vector2]. If the object is an [Area2D], the result is [code](0, 0)[/code]. - [code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data]. [code]normal[/code]: The object's surface normal at the intersection point. [code]point[/code]: The intersection point. [code]rid[/code]: The intersecting object's [RID]. @@ -55,7 +54,6 @@ Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: [code]collider[/code]: The colliding object. [code]collider_id[/code]: The colliding object's ID. - [code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data]. [code]rid[/code]: The intersecting object's [RID]. [code]shape[/code]: The shape index of the colliding shape. Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect (all layers by default), or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively. @@ -75,7 +73,6 @@ Checks whether a point is inside any solid shape, in a specific canvas layer given by [code]canvas_instance_id[/code]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: [code]collider[/code]: The colliding object. [code]collider_id[/code]: The colliding object's ID. - [code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data]. [code]rid[/code]: The intersecting object's [RID]. [code]shape[/code]: The shape index of the colliding shape. Additionally, the method can take an [code]exclude[/code] array of objects or [RID]s that are to be excluded from collisions, a [code]collision_mask[/code] bitmask representing the physics layers to detect (all layers by default), or booleans to determine if the ray should collide with [PhysicsBody2D]s or [Area2D]s, respectively. @@ -94,7 +91,6 @@ Intersects a ray in a given space. The returned object is a dictionary with the following fields: [code]collider[/code]: The colliding object. [code]collider_id[/code]: The colliding object's ID. - [code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data]. [code]normal[/code]: The object's surface normal at the intersection point. [code]position[/code]: The intersection point. [code]rid[/code]: The intersecting object's [RID]. @@ -112,7 +108,6 @@ [b]Note:[/b] This method does not take into account the [code]motion[/code] property of the object. The intersected shapes are returned in an array containing dictionaries with the following fields: [code]collider[/code]: The colliding object. [code]collider_id[/code]: The colliding object's ID. - [code]metadata[/code]: The intersecting shape's metadata. This metadata is different from [method Object.get_meta], and is set with [method PhysicsServer2D.shape_set_data]. [code]rid[/code]: The intersecting object's [RID]. [code]shape[/code]: The shape index of the colliding shape. The number of intersections can be limited with the [code]max_results[/code] parameter, to reduce the processing time. diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 791a04e4c2..b5b6a7ea58 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -395,14 +395,6 @@ Returns the number of shapes assigned to a body. </description> </method> - <method name="body_get_shape_metadata" qualifiers="const"> - <return type="Variant" /> - <argument index="0" name="body" type="RID" /> - <argument index="1" name="shape_idx" type="int" /> - <description> - Returns the metadata of a shape of a body. - </description> - </method> <method name="body_get_shape_transform" qualifiers="const"> <return type="Transform2D" /> <argument index="0" name="body" type="RID" /> @@ -562,15 +554,6 @@ Disables shape in body if [code]disable[/code] is [code]true[/code]. </description> </method> - <method name="body_set_shape_metadata"> - <return type="void" /> - <argument index="0" name="body" type="RID" /> - <argument index="1" name="shape_idx" type="int" /> - <argument index="2" name="metadata" type="Variant" /> - <description> - Sets metadata of a shape within a body. This metadata is different from [method Object.set_meta], and can be retrieved on shape queries. - </description> - </method> <method name="body_set_shape_transform"> <return type="void" /> <argument index="0" name="body" type="RID" /> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index b5be04fb01..d40ad80d68 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -185,6 +185,18 @@ <description> </description> </method> + <method name="canvas_item_add_msdf_texture_rect_region"> + <return type="void" /> + <argument index="0" name="item" type="RID" /> + <argument index="1" name="rect" type="Rect2" /> + <argument index="2" name="texture" type="RID" /> + <argument index="3" name="src_rect" type="Rect2" /> + <argument index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="5" name="outline_size" type="int" default="0" /> + <argument index="6" name="px_range" type="float" default="1.0" /> + <description> + </description> + </method> <method name="canvas_item_add_multimesh"> <return type="void" /> <argument index="0" name="item" type="RID" /> diff --git a/doc/classes/Shortcut.xml b/doc/classes/Shortcut.xml index 9fbe91f38b..f95d069069 100644 --- a/doc/classes/Shortcut.xml +++ b/doc/classes/Shortcut.xml @@ -4,8 +4,8 @@ A shortcut for binding input. </brief_description> <description> - A shortcut for binding input. Shortcuts are commonly used for interacting with a [Control] element from an [InputEvent] (also known as hotkeys). + One shortcut can contain multiple [InputEvent]'s, allowing the possibility of triggering one action with multiple different inputs. </description> <tutorials> </tutorials> @@ -13,27 +13,27 @@ <method name="get_as_text" qualifiers="const"> <return type="String" /> <description> - Returns the shortcut's [InputEvent] as a [String]. + Returns the shortcut's first valid [InputEvent] as a [String]. </description> </method> <method name="has_valid_event" qualifiers="const"> <return type="bool" /> <description> - Returns whether the shortcut has a valid [member event] assigned to it. + Returns whether [member events] contains an [InputEvent] which is valid. </description> </method> <method name="matches_event" qualifiers="const"> <return type="bool" /> <argument index="0" name="event" type="InputEvent" /> <description> - Returns whether the shortcut's [member event] matches [code]event[/code]. + Returns whether any [InputEvent] in [member events] equals [code]event[/code]. </description> </method> </methods> <members> - <member name="event" type="InputEvent" setter="set_event" getter="get_event"> - The shortcut's [InputEvent]. - Generally the [InputEvent] is a keyboard key, though it can be any [InputEvent], including an [InputEventAction]. + <member name="events" type="Array" setter="set_events" getter="get_events" default="[]"> + The shortcut's [InputEvent] array. + Generally the [InputEvent] used is an [InputEventKey], though it can be any [InputEvent], including an [InputEventAction]. </member> </members> </class> diff --git a/doc/classes/StreamPeerExtension.xml b/doc/classes/StreamPeerExtension.xml index 93fda8cf5d..ceb9486a33 100644 --- a/doc/classes/StreamPeerExtension.xml +++ b/doc/classes/StreamPeerExtension.xml @@ -30,7 +30,7 @@ </method> <method name="_put_data" qualifiers="virtual"> <return type="int" /> - <argument index="0" name="p_data" type="const void*" /> + <argument index="0" name="p_data" type="const uint8_t*" /> <argument index="1" name="p_bytes" type="int" /> <argument index="2" name="r_sent" type="int32_t*" /> <description> @@ -38,7 +38,7 @@ </method> <method name="_put_partial_data" qualifiers="virtual"> <return type="int" /> - <argument index="0" name="p_data" type="const void*" /> + <argument index="0" name="p_data" type="const uint8_t*" /> <argument index="1" name="p_bytes" type="int" /> <argument index="2" name="r_sent" type="int32_t*" /> <description> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index e5b03eb4d4..6a4ec08ec3 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -129,14 +129,14 @@ <return type="void" /> <argument index="0" name="flip" type="bool" default="false" /> <description> - Generates normals from vertices so you do not have to do it manually. If [code]flip[/code] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. + Generates normals from vertices so you do not have to do it manually. If [code]flip[/code] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. For correct display of normal-mapped surfaces, you will also have to generate tangents using [method generate_tangents]. [b]Note:[/b] [method generate_normals] only works if the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES]. </description> </method> <method name="generate_tangents"> <return type="void" /> <description> - Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already. + Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see [method generate_normals]). </description> </method> <method name="get_custom_format" qualifiers="const"> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index 3ee3feb365..ded4f0b32f 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -217,18 +217,12 @@ </member> </members> <signals> - <signal name="reposition_active_tab_request"> + <signal name="active_tab_rearranged"> <argument index="0" name="idx_to" type="int" /> <description> Emitted when the active tab is rearranged via mouse drag. See [member drag_to_rearrange_enabled]. </description> </signal> - <signal name="right_button_pressed"> - <argument index="0" name="tab" type="int" /> - <description> - Emitted when a tab is right-clicked. - </description> - </signal> <signal name="tab_changed"> <argument index="0" name="tab" type="int" /> <description> @@ -253,6 +247,12 @@ Emitted when a tab is hovered by the mouse. </description> </signal> + <signal name="tab_rmb_clicked"> + <argument index="0" name="tab" type="int" /> + <description> + Emitted when a tab is right-clicked. + </description> + </signal> </signals> <constants> <constant name="ALIGN_LEFT" value="0" enum="TabAlign"> @@ -281,15 +281,15 @@ </constant> </constants> <theme_items> - <theme_item name="button" data_type="style" type="StyleBox"> + <theme_item name="close" data_type="icon" type="Texture2D"> + The icon for the close button (see [member tab_close_display_policy]). + </theme_item> + <theme_item name="close_bg_highlight" data_type="style" type="StyleBox"> Background of the close button when it's being hovered with the cursor. </theme_item> - <theme_item name="button_pressed" data_type="style" type="StyleBox"> + <theme_item name="close_bg_pressed" data_type="style" type="StyleBox"> Background of the close button when it's being pressed. </theme_item> - <theme_item name="close" data_type="icon" type="Texture2D"> - The icon for the close button (see [member tab_close_display_policy]). - </theme_item> <theme_item name="decrement" data_type="icon" type="Texture2D"> Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. </theme_item> @@ -315,7 +315,7 @@ Font color of the other, unselected tabs. </theme_item> <theme_item name="hseparation" data_type="constant" type="int" default="4"> - The horizontal separation between the tabs. + The horizontal separation between the elements inside tabs. </theme_item> <theme_item name="increment" data_type="icon" type="Texture2D"> Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index aa35acdbd2..e06dfee698 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -281,7 +281,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" default="51"> + <member name="flags" type="int" setter="set_flags" getter="get_flags" default="99"> Line breaking and alignment rules. For more info see [TextServer]. </member> <member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible" default="-1"> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 7fe9278f2c..18ace85465 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TextServer" inherits="Object" version="4.0"> +<class name="TextServer" inherits="RefCounted" version="4.0"> <brief_description> Interface for the fonts and complex text layouts. </brief_description> @@ -487,8 +487,8 @@ </method> <method name="font_set_data"> <return type="void" /> - <argument index="0" name="data" type="RID" /> - <argument index="1" name="arg1" type="PackedByteArray" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="data" type="PackedByteArray" /> <description> Sets font source data, e.g contents of the dynamic font source file. </description> @@ -714,12 +714,14 @@ <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <description> + Returns the dictionary of the supported OpenType features. </description> </method> <method name="font_supported_variation_list" qualifiers="const"> <return type="Dictionary" /> <argument index="0" name="font_rid" type="RID" /> <description> + Returns the dictionary of the supported OpenType variation coordinates. </description> </method> <method name="format_number" qualifiers="const"> @@ -737,6 +739,12 @@ Frees an object created by this [TextServer]. </description> </method> + <method name="get_features" qualifiers="const"> + <return type="int" /> + <description> + Returns text server features, see [enum Feature]. + </description> + </method> <method name="get_hex_code_box_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="size" type="int" /> @@ -751,6 +759,18 @@ Returns the name of the server interface. </description> </method> + <method name="get_support_data_filename" qualifiers="const"> + <return type="String" /> + <description> + Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename. + </description> + </method> + <method name="get_support_data_info" qualifiers="const"> + <return type="String" /> + <description> + Returns TextServer database (e.g. ICU break iterators and dictionaries) description. + </description> + </method> <method name="has"> <return type="bool" /> <argument index="0" name="rid" type="RID" /> @@ -758,14 +778,14 @@ Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server. </description> </method> - <method name="has_feature"> + <method name="has_feature" qualifiers="const"> <return type="bool" /> <argument index="0" name="feature" type="int" enum="TextServer.Feature" /> <description> Returns [code]true[/code] if the server supports a feature. </description> </method> - <method name="is_locale_right_to_left"> + <method name="is_locale_right_to_left" qualifiers="const"> <return type="bool" /> <argument index="0" name="locale" type="String" /> <description> @@ -802,6 +822,14 @@ Returns percent sign used in the [code]language[/code]. </description> </method> + <method name="save_support_data" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="filename" type="String" /> + <description> + Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file. + Note: This function is used by during project export, to include TextServer database. + </description> + </method> <method name="shaped_text_add_object"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> @@ -898,7 +926,7 @@ Returns direction of the text. </description> </method> - <method name="shaped_text_get_dominant_direciton_in_range" qualifiers="const"> + <method name="shaped_text_get_dominant_direction_in_range" qualifiers="const"> <return type="int" enum="TextServer.Direction" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="start" type="int" /> @@ -907,30 +935,58 @@ Returns dominant direction of in the range of text. </description> </method> + <method name="shaped_text_get_ellipsis_glyph_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns number of glyphs in the ellipsis. + </description> + </method> + <method name="shaped_text_get_ellipsis_glyphs" qualifiers="const"> + <return type="Array" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns array of the glyphs in the ellipsis. + </description> + </method> + <method name="shaped_text_get_ellipsis_pos" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns position of the ellipsis. + </description> + </method> + <method name="shaped_text_get_glyph_count" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns number of glyphs in the buffer. + </description> + </method> <method name="shaped_text_get_glyphs" qualifiers="const"> <return type="Array" /> <argument index="0" name="shaped" type="RID" /> <description> - Returns text glyphs. + Returns text glyphs in the visual order. </description> </method> <method name="shaped_text_get_line_breaks" qualifiers="const"> - <return type="Array" /> + <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="float" /> <argument index="2" name="start" type="int" default="0" /> - <argument index="3" name="break_flags" type="int" default="48" /> + <argument index="3" name="break_flags" type="int" default="96" /> <description> Breaks text to the lines and returns character ranges for each line. </description> </method> <method name="shaped_text_get_line_breaks_adv" qualifiers="const"> - <return type="Array" /> + <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="width" type="PackedFloat32Array" /> <argument index="2" name="start" type="int" default="0" /> <argument index="3" name="once" type="bool" default="true" /> - <argument index="4" name="break_flags" type="int" default="48" /> + <argument index="4" name="break_flags" type="int" default="96" /> <description> Breaks text to the lines and columns. Returns character ranges for each segment. </description> @@ -987,7 +1043,7 @@ </description> </method> <method name="shaped_text_get_selection" qualifiers="const"> - <return type="Array" /> + <return type="PackedVector2Array" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="start" type="int" /> <argument index="2" name="end" type="int" /> @@ -1002,6 +1058,13 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_trim_pos" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns position of the trim. + </description> + </method> <method name="shaped_text_get_underline_position" qualifiers="const"> <return type="float" /> <argument index="0" name="shaped" type="RID" /> @@ -1024,8 +1087,9 @@ </description> </method> <method name="shaped_text_get_word_breaks" qualifiers="const"> - <return type="Array" /> + <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="grapheme_flags" type="int" /> <description> Breaks text into words and returns array of character ranges. </description> @@ -1053,7 +1117,7 @@ Returns [code]true[/code] if buffer is successfully shaped. </description> </method> - <method name="shaped_text_next_grapheme_pos"> + <method name="shaped_text_next_grapheme_pos" qualifiers="const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="pos" type="int" /> @@ -1070,7 +1134,7 @@ Trims text if it exceeds the given width. </description> </method> - <method name="shaped_text_prev_grapheme_pos"> + <method name="shaped_text_prev_grapheme_pos" qualifiers="const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> <argument index="1" name="pos" type="int" /> @@ -1139,6 +1203,13 @@ Note: It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested. </description> </method> + <method name="shaped_text_sort_logical"> + <return type="Array" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns text glyphs in the logical order. + </description> + </method> <method name="shaped_text_substr" qualifiers="const"> <return type="RID" /> <argument index="0" name="shaped" type="RID" /> @@ -1196,18 +1267,24 @@ <constant name="JUSTIFICATION_AFTER_LAST_TAB" value="8" enum="JustificationFlag"> Only apply justification to the part of the text after the last tab. </constant> + <constant name="JUSTIFICATION_CONSTRAIN_ELLIPSIS" value="16" enum="JustificationFlag"> + Apply justification to the trimmed line with ellipsis. + </constant> <constant name="BREAK_NONE" value="0" enum="LineBreakFlag"> Do not break the line. </constant> - <constant name="BREAK_MANDATORY" value="16" enum="LineBreakFlag"> + <constant name="BREAK_MANDATORY" value="32" enum="LineBreakFlag"> Break the line at the line mandatory break characters (e.g. [code]"\n"[/code]). </constant> - <constant name="BREAK_WORD_BOUND" value="32" enum="LineBreakFlag"> + <constant name="BREAK_WORD_BOUND" value="64" enum="LineBreakFlag"> Break the line between the words. </constant> - <constant name="BREAK_GRAPHEME_BOUND" value="64" enum="LineBreakFlag"> + <constant name="BREAK_GRAPHEME_BOUND" value="128" enum="LineBreakFlag"> Break the line between any unconnected graphemes. </constant> + <constant name="BREAK_WORD_BOUND_ADAPTIVE" value="320" enum="LineBreakFlag"> + Break the line between the words, or any unconnected graphemes if line is too short to fit the whole word. + </constant> <constant name="OVERRUN_NO_TRIMMING" value="0" enum="TextOverrunFlag"> No trimming is performed. </constant> @@ -1223,6 +1300,11 @@ <constant name="OVERRUN_ENFORCE_ELLIPSIS" value="8" enum="TextOverrunFlag"> Determines whether the ellipsis at the end of the text is enforced and may not be hidden. </constant> + <constant name="OVERRUN_JUSTIFICATION_AWARE" value="16" enum="TextOverrunFlag"> + </constant> + <constant name="GRAPHEME_IS_VALID" value="1" enum="GraphemeFlag"> + Grapheme is supprted by the font, and can be drawn. + </constant> <constant name="GRAPHEME_IS_RTL" value="2" enum="GraphemeFlag"> Grapheme is part of right-to-left or bottom-to-top run. </constant> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml new file mode 100644 index 0000000000..29571463d2 --- /dev/null +++ b/doc/classes/TextServerExtension.xml @@ -0,0 +1,1262 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="TextServerExtension" inherits="TextServer" version="4.0"> + <brief_description> + Base class for TextServer custom implementations (plugins). + </brief_description> + <description> + External TextServer implementations should inherit from this class. + </description> + <tutorials> + </tutorials> + <methods> + <method name="_create_font" qualifiers="virtual"> + <return type="RID" /> + <description> + Creates new, empty font cache entry resource. To free the resulting resourec, use [method _free] method. + </description> + </method> + <method name="_create_shaped_text" qualifiers="virtual"> + <return type="RID" /> + <argument index="0" name="direction" type="int" enum="TextServer.Direction" /> + <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" /> + <description> + Creates new buffer for complex text layout, with the given [code]direction[/code] and [code]orientation[/code]. To free the resulting buffer, use [method _free] method. + Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature. + Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature. + </description> + </method> + <method name="_draw_hex_code_box" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="canvas" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="pos" type="Vector2" /> + <argument index="3" name="index" type="int" /> + <argument index="4" name="color" type="Color" /> + <description> + Draws box displaying character hexadecimal code. Used for replacing missing characters. + </description> + </method> + <method name="_font_clear_glyphs" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <description> + Removes all rendered glyphs information from the cache entry. Note: This function will not remove textures associated with the glyphs, use [method _font_remove_texture] to remove them manually. + </description> + </method> + <method name="_font_clear_kerning_map" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Removes all kerning overrides. + </description> + </method> + <method name="_font_clear_size_cache" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Removes all font sizes from the cache entry + </description> + </method> + <method name="_font_clear_textures" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <description> + Removes all textures from font cache entry. Note: This function will not remove glyphs associated with the texture, use [method _font_remove_glyph] to remove them manually. + </description> + </method> + <method name="_font_draw_glyph" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="canvas" type="RID" /> + <argument index="2" name="size" type="int" /> + <argument index="3" name="pos" type="Vector2" /> + <argument index="4" name="index" type="int" /> + <argument index="5" name="color" type="Color" /> + <description> + Draws single glyph into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. + Note: Glyph index is specific to the font, use glyphs indices returned by [method _shaped_text_get_glyphs] or [method _font_get_glyph_index]. + </description> + </method> + <method name="_font_draw_glyph_outline" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="canvas" type="RID" /> + <argument index="2" name="size" type="int" /> + <argument index="3" name="outline_size" type="int" /> + <argument index="4" name="pos" type="Vector2" /> + <argument index="5" name="index" type="int" /> + <argument index="6" name="color" type="Color" /> + <description> + Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font_rid[/code] at the size [code]size[/code]. + Note: Glyph index is specific to the font, use glyphs indices returned by [method _shaped_text_get_glyphs] or [method _font_get_glyph_index]. + </description> + </method> + <method name="_font_get_ascent" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Returns the font ascent (number of pixels above the baseline). + </description> + </method> + <method name="_font_get_descent" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Returns the font descent (number of pixels below the baseline). + </description> + </method> + <method name="_font_get_fixed_size" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns bitmap font fixed size. + </description> + </method> + <method name="_font_get_global_oversampling" qualifiers="virtual const"> + <return type="float" /> + <description> + Returns the font oversampling factor, shared by all fonts in the TextServer. + </description> + </method> + <method name="_font_get_glyph_advance" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns glyph advance (offset of the next glyph). Note: advance for glyphs outlines is the same as the base glyph advance and is not saved. + </description> + </method> + <method name="_font_get_glyph_contours" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="index" type="int" /> + <description> + Returns outline contours of the glyph as a [code]Dictionary[/code] with the following contents: + [code]points[/code] - [PackedVector3Array], containing outline points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/code] is the type of the point, using the [enum TextServer.ContourPointTag] values. + [code]contours[/code] - [PackedInt32Array], containing indices the end points of each contour. + [code]orientation[/code] - [bool], contour orientation. If [code]true[/code], clockwise contours must be filled. + </description> + </method> + <method name="_font_get_glyph_index" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="char" type="int" /> + <argument index="3" name="variation_selector" type="int" /> + <description> + Returns the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code]. + </description> + </method> + <method name="_font_get_glyph_list" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <description> + Returns list of rendered glyphs in the cache entry. + </description> + </method> + <method name="_font_get_glyph_offset" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns glyph offset from the baseline. + </description> + </method> + <method name="_font_get_glyph_size" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns size of the glyph. + </description> + </method> + <method name="_font_get_glyph_texture_idx" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns index of the cache texture containing the glyph. + </description> + </method> + <method name="_font_get_glyph_uv_rect" qualifiers="virtual const"> + <return type="Rect2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Returns rectangle in the cache texture containing the glyph. + </description> + </method> + <method name="_font_get_hinting" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns the font hinting mode. Used by dynamic fonts only. + </description> + </method> + <method name="_font_get_kerning" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="glyph_pair" type="Vector2i" /> + <description> + Returns kerning for the pair of glyphs. + </description> + </method> + <method name="_font_get_kerning_list" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Returns list of the kerning overrides. + </description> + </method> + <method name="_font_get_language_support_override" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="language" type="String" /> + <description> + Returns [code]true[/code] if support override is enabled for the [code]language[/code]. + </description> + </method> + <method name="_font_get_language_support_overrides" qualifiers="virtual"> + <return type="PackedStringArray" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns list of language support overrides. + </description> + </method> + <method name="_font_get_msdf_pixel_range" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Return the width of the range around the shape between the minimum and maximum representable signed distance. + </description> + </method> + <method name="_font_get_msdf_size" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns source font size used to generate MSDF textures. + </description> + </method> + <method name="_font_get_oversampling" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. + </description> + </method> + <method name="_font_get_scale" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Returns scaling factor of the color bitmap font. + </description> + </method> + <method name="_font_get_script_support_override" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="script" type="String" /> + <description> + Returns [code]true[/code] if support override is enabled for the [code]script[/code]. + </description> + </method> + <method name="_font_get_script_support_overrides" qualifiers="virtual"> + <return type="PackedStringArray" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns list of script support overrides. + </description> + </method> + <method name="_font_get_size_cache_list" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Return list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. + </description> + </method> + <method name="_font_get_spacing" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs in pixels. + </description> + </method> + <method name="_font_get_supported_chars" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns a string containing all the characters available in the font. + </description> + </method> + <method name="_font_get_texture_count" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <description> + Returns number of textures used by font cache entry. + </description> + </method> + <method name="_font_get_texture_image" qualifiers="virtual const"> + <return type="Image" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="texture_index" type="int" /> + <description> + Returns font cache texture image data. + </description> + </method> + <method name="_font_get_texture_offsets" qualifiers="virtual const"> + <return type="PackedInt32Array" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="texture_index" type="int" /> + <description> + Returns array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + </description> + </method> + <method name="_font_get_underline_position" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Returns pixel offset of the underline below the baseline. + </description> + </method> + <method name="_font_get_underline_thickness" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <description> + Returns thickness of the underline in pixels. + </description> + </method> + <method name="_font_get_variation_coordinates" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns variation coordinates for the specified font cache entry. See [method _font_supported_variation_list] for more info. + </description> + </method> + <method name="_font_has_char" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="char" type="int" /> + <description> + Return [code]true[/code] if a Unicode [code]char[/code] is available in the font. + </description> + </method> + <method name="_font_is_antialiased" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns [code]true[/code] if font 8-bit anitialiased glyph rendering is supported and enabled. + </description> + </method> + <method name="_font_is_force_autohinter" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns [code]true[/code] if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only. + </description> + </method> + <method name="_font_is_language_supported" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="language" type="String" /> + <description> + Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). + </description> + </method> + <method name="_font_is_multichannel_signed_distance_field" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns [code]true[/code] if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. + </description> + </method> + <method name="_font_is_script_supported" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="script" type="String" /> + <description> + Returns [code]true[/code], if font supports given script (ISO 15924 code). + </description> + </method> + <method name="_font_remove_glyph" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <description> + Removes specified rendered glyph information from the cache entry. Note: This function will not remove textures associated with the glyphs, use [method _font_remove_texture] to remove them manually. + </description> + </method> + <method name="_font_remove_kerning" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="glyph_pair" type="Vector2i" /> + <description> + Removes kerning override for the pair of glyphs. + </description> + </method> + <method name="_font_remove_language_support_override" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="language" type="String" /> + <description> + Remove language support override. + </description> + </method> + <method name="_font_remove_script_support_override" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="script" type="String" /> + <description> + Removes script support override. + </description> + </method> + <method name="_font_remove_size_cache" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <description> + Removes specified font size from the cache entry. + </description> + </method> + <method name="_font_remove_texture" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="texture_index" type="int" /> + <description> + Removes specified texture from font cache entry. Note: This function will not remove glyphs associated with the texture, remove them manually, using [method _font_remove_glyph]. + </description> + </method> + <method name="_font_render_glyph" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="index" type="int" /> + <description> + Renders specified glyph the the font cache texture. + </description> + </method> + <method name="_font_render_range" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="start" type="int" /> + <argument index="3" name="end" type="int" /> + <description> + Renders the range of characters to the font cache texture. + </description> + </method> + <method name="_font_set_antialiased" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="antialiased" type="bool" /> + <description> + If set to [code]true[/code], 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only. + </description> + </method> + <method name="_font_set_ascent" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="ascent" type="float" /> + <description> + Sets the font ascent (number of pixels above the baseline). + </description> + </method> + <method name="_font_set_data" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="data" type="PackedByteArray" /> + <description> + Sets font source data, e.g contents of the dynamic font source file. + </description> + </method> + <method name="_font_set_data_ptr" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="data_ptr" type="const uint8_t*" /> + <argument index="2" name="data_size" type="int" /> + <description> + Sets the font descent (number of pixels below the baseline). + </description> + </method> + <method name="_font_set_descent" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="descent" type="float" /> + <description> + Sets bitmap font fixed size. If set to value greater than zero, same cache entry will be used for all font sizes. + </description> + </method> + <method name="_font_set_fixed_size" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="fixed_size" type="int" /> + <description> + If set to [code]true[/code] auto-hinting is preffered over font built-in hinting. + </description> + </method> + <method name="_font_set_force_autohinter" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="force_autohinter" type="bool" /> + <description> + </description> + </method> + <method name="_font_set_global_oversampling" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="oversampling" type="float" /> + <description> + Sets oversampling factor, shared by all font in the TextServer. + Note: This value can be automaticaly changed by display server. + </description> + </method> + <method name="_font_set_glyph_advance" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="glyph" type="int" /> + <argument index="3" name="advance" type="Vector2" /> + <description> + Sets glyph advance (offset of the next glyph). Note: advance for glyphs outlines is the same as the base glyph advance and is not saved. + </description> + </method> + <method name="_font_set_glyph_offset" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <argument index="3" name="offset" type="Vector2" /> + <description> + Sets glyph offset from the baseline. + </description> + </method> + <method name="_font_set_glyph_size" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <argument index="3" name="gl_size" type="Vector2" /> + <description> + Sets size of the glyph. + </description> + </method> + <method name="_font_set_glyph_texture_idx" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <argument index="3" name="texture_idx" type="int" /> + <description> + Sets index of the cache texture containing the glyph. + </description> + </method> + <method name="_font_set_glyph_uv_rect" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="glyph" type="int" /> + <argument index="3" name="uv_rect" type="Rect2" /> + <description> + Sets rectangle in the cache texture containing the glyph. + </description> + </method> + <method name="_font_set_hinting" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="hinting" type="int" enum="TextServer.Hinting" /> + <description> + Sets font hinting mode. Used by dynamic fonts only. + </description> + </method> + <method name="_font_set_kerning" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="glyph_pair" type="Vector2i" /> + <argument index="3" name="kerning" type="Vector2" /> + <description> + Sets kerning for the pair of glyphs. + </description> + </method> + <method name="_font_set_language_support_override" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="language" type="String" /> + <argument index="2" name="supported" type="bool" /> + <description> + Adds override for [method _font_is_language_supported]. + </description> + </method> + <method name="_font_set_msdf_pixel_range" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="msdf_pixel_range" type="int" /> + <description> + Sets the width of the range around the shape between the minimum and maximum representable signed distance. + </description> + </method> + <method name="_font_set_msdf_size" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="msdf_size" type="int" /> + <description> + Sets source font size used to generate MSDF textures. + </description> + </method> + <method name="_font_set_multichannel_signed_distance_field" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="msdf" type="bool" /> + <description> + If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. + </description> + </method> + <method name="_font_set_oversampling" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="oversampling" type="float" /> + <description> + Sets font oversampling factor, if set to [code]0.0[/code] global oversampling factor is used instead. Used by dynamic fonts only. + </description> + </method> + <method name="_font_set_scale" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="scale" type="float" /> + <description> + Sets scaling factor of the color bitmap font. + </description> + </method> + <method name="_font_set_script_support_override" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="script" type="String" /> + <argument index="2" name="supported" type="bool" /> + <description> + Adds override for [method _font_is_script_supported]. + </description> + </method> + <method name="_font_set_spacing" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="3" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs in pixels. + </description> + </method> + <method name="_font_set_texture_image" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="texture_index" type="int" /> + <argument index="3" name="image" type="Image" /> + <description> + Sets font cache texture image data. + </description> + </method> + <method name="_font_set_texture_offsets" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="Vector2i" /> + <argument index="2" name="texture_index" type="int" /> + <argument index="3" name="offset" type="PackedInt32Array" /> + <description> + Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. + </description> + </method> + <method name="_font_set_underline_position" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_position" type="float" /> + <description> + Sets pixel offset of the underline below the baseline. + </description> + </method> + <method name="_font_set_underline_thickness" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_thickness" type="float" /> + <description> + Sets thickness of the underline in pixels. + </description> + </method> + <method name="_font_set_variation_coordinates" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="font_rid" type="RID" /> + <argument index="1" name="variation_coordinates" type="Dictionary" /> + <description> + Sets variation coordinates for the specified font cache entry. See [method _font_supported_variation_list] for more info. + </description> + </method> + <method name="_font_supported_feature_list" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns the dictionary of the supported OpenType features. + </description> + </method> + <method name="_font_supported_variation_list" qualifiers="virtual const"> + <return type="Dictionary" /> + <argument index="0" name="font_rid" type="RID" /> + <description> + Returns the dictionary of the supported OpenType variation coordinates. + </description> + </method> + <method name="_format_number" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="string" type="String" /> + <argument index="1" name="language" type="String" /> + <description> + Converts a number from the Western Arabic (0..9) to the numeral systems used in [code]language[/code]. + </description> + </method> + <method name="_free" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="rid" type="RID" /> + <description> + Frees an object created by this [TextServer]. + </description> + </method> + <method name="_get_features" qualifiers="virtual const"> + <return type="int" /> + <description> + Returns text server features, see [enum TextServer.Feature]. + </description> + </method> + <method name="_get_hex_code_box_size" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="size" type="int" /> + <argument index="1" name="index" type="int" /> + <description> + Returns size of the replacement character (box with character hexadecimal code that is drawn in place of invalid characters). + </description> + </method> + <method name="_get_name" qualifiers="virtual const"> + <return type="String" /> + <description> + Returns the name of the server interface. + </description> + </method> + <method name="_get_support_data_filename" qualifiers="virtual const"> + <return type="String" /> + <description> + Returns default TextServer database (e.g. ICU break iterators and dictionaries) filename. + </description> + </method> + <method name="_get_support_data_info" qualifiers="virtual const"> + <return type="String" /> + <description> + Returns TextServer database (e.g. ICU break iterators and dictionaries) description. + </description> + </method> + <method name="_has" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="rid" type="RID" /> + <description> + Returns [code]true[/code] if [code]rid[/code] is valid resource owned by this text server. + </description> + </method> + <method name="_has_feature" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="feature" type="int" enum="TextServer.Feature" /> + <description> + Returns [code]true[/code] if the server supports a feature. + </description> + </method> + <method name="_is_locale_right_to_left" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="locale" type="String" /> + <description> + Returns [code]true[/code] if locale is right-to-left. + </description> + </method> + <method name="_load_support_data" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="filename" type="String" /> + <description> + Loads optional TextServer database (e.g. ICU break iterators and dictionaries). + Note: This function should be called before any other TextServer functions used, otherwise it won't have any effect. + </description> + </method> + <method name="_name_to_tag" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="name" type="String" /> + <description> + Converts readable feature, variation, script or language name to OpenType tag. + </description> + </method> + <method name="_parse_number" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="string" type="String" /> + <argument index="1" name="language" type="String" /> + <description> + Converts a number from the numeral systems used in [code]language[/code] to Western Arabic (0..9). + </description> + </method> + <method name="_percent_sign" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="language" type="String" /> + <description> + Returns percent sign used in the [code]language[/code]. + </description> + </method> + <method name="_save_support_data" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="filename" type="String" /> + <description> + Saves optional TextServer database (e.g. ICU break iterators and dictionaries) to the file. + Note: This function is used by during project export, to include TextServer database. + </description> + </method> + <method name="_shaped_text_add_object" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="key" type="Variant" /> + <argument index="2" name="size" type="Vector2" /> + <argument index="3" name="inline_align" type="int" enum="InlineAlign" /> + <argument index="4" name="length" type="int" /> + <description> + Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters. + </description> + </method> + <method name="_shaped_text_add_string" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="text" type="String" /> + <argument index="2" name="fonts" type="Array" /> + <argument index="3" name="size" type="int" /> + <argument index="4" name="opentype_features" type="Dictionary" /> + <argument index="5" name="language" type="String" /> + <description> + Adds text span and font to draw it to the text buffer. + </description> + </method> + <method name="_shaped_text_clear" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Clears text buffer (removes text and inline objects). + </description> + </method> + <method name="_shaped_text_draw" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="canvas" type="RID" /> + <argument index="2" name="pos" type="Vector2" /> + <argument index="3" name="clip_l" type="float" /> + <argument index="4" name="clip_r" type="float" /> + <argument index="5" name="color" type="Color" /> + <description> + Draw shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). + </description> + </method> + <method name="_shaped_text_draw_outline" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="canvas" type="RID" /> + <argument index="2" name="pos" type="Vector2" /> + <argument index="3" name="clip_l" type="float" /> + <argument index="4" name="clip_r" type="float" /> + <argument index="5" name="outline_size" type="int" /> + <argument index="6" name="color" type="Color" /> + <description> + Draw the outline of the shaped text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the leftmost point of the baseline (for horizontal layout) or topmost point of the baseline (for vertical layout). + </description> + </method> + <method name="_shaped_text_fit_to_width" qualifiers="virtual"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="width" type="float" /> + <argument index="2" name="jst_flags" type="int" /> + <description> + Adjusts text with to fit to specified width, returns new text width + </description> + </method> + <method name="_shaped_text_get_ascent" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). + Note: overall ascent can be higher than font ascent, if some glyphs are displaced from the baseline. + </description> + </method> + <method name="_shaped_text_get_carets" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="position" type="int" /> + <argument index="2" name="caret" type="CaretInfo*" /> + <description> + Returns shapes of the carets corresponding to the character offset [code]position[/code] in the text. Returned caret shape is 1 pixel wide rectangle. + </description> + </method> + <method name="_shaped_text_get_descent" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). + Note: overall descent can be higher than font descent, if some glyphs are displaced from the baseline. + </description> + </method> + <method name="_shaped_text_get_direction" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns direction of the text. + </description> + </method> + <method name="_shaped_text_get_dominant_direction_in_range" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="start" type="int" /> + <argument index="2" name="end" type="int" /> + <description> + Returns dominant direction of in the range of text. + </description> + </method> + <method name="_shaped_text_get_ellipsis_glyph_count" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns number of glyphs in the ellipsis. + </description> + </method> + <method name="_shaped_text_get_ellipsis_glyphs" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="r_glyphs" type="void*" /> + <description> + Returns array of the glyphs in the ellipsis. + </description> + </method> + <method name="_shaped_text_get_ellipsis_pos" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns position of the ellipsis. + </description> + </method> + <method name="_shaped_text_get_glyph_count" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns text glyphs count. + </description> + </method> + <method name="_shaped_text_get_glyphs" qualifiers="virtual const"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="r_glyphs" type="void*" /> + <description> + Copies text glyphs in the visual order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count]. + </description> + </method> + <method name="_shaped_text_get_line_breaks" qualifiers="virtual const"> + <return type="PackedInt32Array" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="width" type="float" /> + <argument index="2" name="start" type="int" /> + <argument index="3" name="break_flags" type="int" /> + <description> + Breaks text to the lines and returns character ranges for each line. + </description> + </method> + <method name="_shaped_text_get_line_breaks_adv" qualifiers="virtual const"> + <return type="PackedInt32Array" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="width" type="PackedFloat32Array" /> + <argument index="2" name="start" type="int" /> + <argument index="3" name="once" type="bool" /> + <argument index="4" name="break_flags" type="int" /> + <description> + Breaks text to the lines and columns. Returns character ranges for each segment. + </description> + </method> + <method name="_shaped_text_get_object_rect" qualifiers="virtual const"> + <return type="Rect2" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="key" type="Variant" /> + <description> + Returns bounding rectangle of the inline object. + </description> + </method> + <method name="_shaped_text_get_objects" qualifiers="virtual const"> + <return type="Array" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns array of inline objects. + </description> + </method> + <method name="_shaped_text_get_orientation" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns text orientation. + </description> + </method> + <method name="_shaped_text_get_parent" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Sets text orientation. + </description> + </method> + <method name="_shaped_text_get_preserve_control" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns [code]true[/code] if text buffer is configured to display control characters. + </description> + </method> + <method name="_shaped_text_get_preserve_invalid" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns [code]true[/code] if text buffer is configured to display hexadecimal codes in place of invalid characters. + Note: If set to [code]false[/code], nothing is displayed in place of invalid characters. + </description> + </method> + <method name="_shaped_text_get_range" qualifiers="virtual const"> + <return type="Vector2i" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns substring buffer character range in the parent buffer. + </description> + </method> + <method name="_shaped_text_get_selection" qualifiers="virtual const"> + <return type="PackedVector2Array" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="start" type="int" /> + <argument index="2" name="end" type="int" /> + <description> + Returns selection rectangles for the specified character range. + </description> + </method> + <method name="_shaped_text_get_size" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns size of the text. + </description> + </method> + <method name="_shaped_text_get_trim_pos" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns ellipsis and trim positions. + </description> + </method> + <method name="_shaped_text_get_underline_position" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns pixel offset of the underline below the baseline. + </description> + </method> + <method name="_shaped_text_get_underline_thickness" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns thickness of the underline. + </description> + </method> + <method name="_shaped_text_get_width" qualifiers="virtual const"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns width (for horizontal layout) or height (for vertical) of the text. + </description> + </method> + <method name="_shaped_text_get_word_breaks" qualifiers="virtual const"> + <return type="PackedInt32Array" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="grapheme_flags" type="int" /> + <description> + Breaks text into words and returns array of character ranges. + </description> + </method> + <method name="_shaped_text_hit_test_grapheme" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="coord" type="float" /> + <description> + Returns grapheme index at the specified pixel offset at the baseline, or [code]-1[/code] if none is found. + </description> + </method> + <method name="_shaped_text_hit_test_position" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="coord" type="float" /> + <description> + Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position. + </description> + </method> + <method name="_shaped_text_is_ready" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Returns [code]true[/code] if buffer is successfully shaped. + </description> + </method> + <method name="_shaped_text_next_grapheme_pos" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="pos" type="int" /> + <description> + Returns composite character end position closest to the [code]pos[/code]. + </description> + </method> + <method name="_shaped_text_overrun_trim_to_width" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="width" type="float" /> + <argument index="2" name="trim_flags" type="int" /> + <description> + Trims text if it exceeds the given width. + </description> + </method> + <method name="_shaped_text_prev_grapheme_pos" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="pos" type="int" /> + <description> + Returns composite character start position closest to the [code]pos[/code]. + </description> + </method> + <method name="_shaped_text_resize_object" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="key" type="Variant" /> + <argument index="2" name="size" type="Vector2" /> + <argument index="3" name="inline_align" type="int" enum="InlineAlign" /> + <description> + Sets new size and alignment of embedded object. + </description> + </method> + <method name="_shaped_text_set_bidi_override" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="override" type="Array" /> + <description> + Overrides BiDi for the structured text. + Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. + </description> + </method> + <method name="_shaped_text_set_direction" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="direction" type="int" enum="TextServer.Direction" /> + <description> + Sets desired text direction. If set to [code]TEXT_DIRECTION_AUTO[/code], direction will be detected based on the buffer contents and current locale. + Note: Direction is ignored if server does not support [code]FEATURE_BIDI_LAYOUT[/code] feature. + </description> + </method> + <method name="_shaped_text_set_orientation" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="orientation" type="int" enum="TextServer.Orientation" /> + <description> + Sets desired text orientation. + Note: Orientation is ignored if server does not support [code]FEATURE_VERTICAL_LAYOUT[/code] feature. + </description> + </method> + <method name="_shaped_text_set_preserve_control" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="enabled" type="bool" /> + <description> + If set to [code]true[/code] text buffer will display control characters. + </description> + </method> + <method name="_shaped_text_set_preserve_invalid" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="enabled" type="bool" /> + <description> + If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. + </description> + </method> + <method name="_shaped_text_shape" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Shapes buffer if it's not shaped. Returns [code]true[/code] if the string is shaped successfully. + Note: It is not necessary to call this function manually, buffer will be shaped automatically as soon as any of its output data is requested. + </description> + </method> + <method name="_shaped_text_sort_logical" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="r_glyphs" type="void*" /> + <description> + Copies text glyphs in the logical order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count]. + </description> + </method> + <method name="_shaped_text_substr" qualifiers="virtual const"> + <return type="RID" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="start" type="int" /> + <argument index="2" name="length" type="int" /> + <description> + Returns text buffer for the substring of the text in the [code]shaped[/code] text buffer (including inline objects). + </description> + </method> + <method name="_shaped_text_tab_align" qualifiers="virtual"> + <return type="float" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="tab_stops" type="PackedFloat32Array" /> + <description> + Aligns shaped text to the given tab-stops. + </description> + </method> + <method name="_shaped_text_update_breaks" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Updates line and word breaks. + </description> + </method> + <method name="_shaped_text_update_justification_ops" qualifiers="virtual"> + <return type="bool" /> + <argument index="0" name="shaped" type="RID" /> + <description> + Updates justification opportunities (spaces, kashidas, etc.). + </description> + </method> + <method name="_tag_to_name" qualifiers="virtual const"> + <return type="String" /> + <argument index="0" name="tag" type="int" /> + <description> + Converts OpenType tag to readable feature, variation, script or language name. + </description> + </method> + </methods> +</class> diff --git a/doc/classes/TextServerManager.xml b/doc/classes/TextServerManager.xml index 0e7b6d15d3..aa2177c3b1 100644 --- a/doc/classes/TextServerManager.xml +++ b/doc/classes/TextServerManager.xml @@ -10,6 +10,13 @@ <tutorials> </tutorials> <methods> + <method name="add_interface"> + <return type="void" /> + <argument index="0" name="interface" type="TextServer" /> + <description> + Registers an [TextServer] interface. + </description> + </method> <method name="find_interface" qualifiers="const"> <return type="TextServer" /> <argument index="0" name="name" type="String" /> @@ -19,7 +26,7 @@ </method> <method name="get_interface" qualifiers="const"> <return type="TextServer" /> - <argument index="0" name="index" type="int" /> + <argument index="0" name="idx" type="int" /> <description> Returns the interface registered at a given index. </description> @@ -30,20 +37,6 @@ Returns the number of interfaces currently registered. </description> </method> - <method name="get_interface_features" qualifiers="const"> - <return type="int" /> - <argument index="0" name="index" type="int" /> - <description> - Returns text server supported features (binary OR). - </description> - </method> - <method name="get_interface_name" qualifiers="const"> - <return type="String" /> - <argument index="0" name="index" type="int" /> - <description> - Returns the interface name registered at a given index. - </description> - </method> <method name="get_interfaces" qualifiers="const"> <return type="Array" /> <description> @@ -53,15 +46,36 @@ <method name="get_primary_interface" qualifiers="const"> <return type="TextServer" /> <description> - Returns the primary [TextServer] interface. + Returns the primary [TextServer] interface currently in use. + </description> + </method> + <method name="remove_interface"> + <return type="void" /> + <argument index="0" name="interface" type="TextServer" /> + <description> + Removes interface. All fonts and shaped text caches should be freed before removing interface. </description> </method> <method name="set_primary_interface"> - <return type="bool" /> - <argument index="0" name="index" type="int" /> + <return type="void" /> + <argument index="0" name="index" type="TextServer" /> <description> - Sets (and initializes it if required) interface registered at a given index as the primary. Invalidates all references to the fonts and text buffers. + Sets the primary [TextServer] interface. </description> </method> </methods> + <signals> + <signal name="interface_added"> + <argument index="0" name="interface_name" type="StringName" /> + <description> + Emitted when a new interface has been added. + </description> + </signal> + <signal name="interface_removed"> + <argument index="0" name="interface_name" type="StringName" /> + <description> + Emitted when an interface is removed. + </description> + </signal> + </signals> </class> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index 0d3282c6d3..81c5743ccc 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -37,6 +37,20 @@ Returns how many polygons the tile has for TileSet physics layer with index [code]layer_id[/code]. </description> </method> + <method name="get_constant_angular_velocity" qualifiers="const"> + <return type="float" /> + <argument index="0" name="layer_id" type="int" /> + <description> + Returns the constant angular velocity applied to objects colliding with this tile. + </description> + </method> + <method name="get_constant_linear_velocity" qualifiers="const"> + <return type="Vector2" /> + <argument index="0" name="layer_id" type="int" /> + <description> + Returns the constant linear velocity applied to objects colliding with this tile. + </description> + </method> <method name="get_custom_data" qualifiers="const"> <return type="Variant" /> <argument index="0" name="layer_name" type="String" /> @@ -123,6 +137,22 @@ Sets the polygons count for TileSet physics layer with index [code]layer_id[/code]. </description> </method> + <method name="set_constant_angular_velocity"> + <return type="void" /> + <argument index="0" name="layer_id" type="int" /> + <argument index="1" name="velocity" type="float" /> + <description> + Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile. + </description> + </method> + <method name="set_constant_linear_velocity"> + <return type="void" /> + <argument index="0" name="layer_id" type="int" /> + <argument index="1" name="velocity" type="Vector2" /> + <description> + Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts. + </description> + </method> <method name="set_custom_data"> <return type="void" /> <argument index="0" name="layer_name" type="String" /> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 4621d138ac..e5fe823be6 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -29,6 +29,13 @@ Clears all cells. </description> </method> + <method name="clear_layer"> + <return type="void" /> + <argument index="0" name="layer" type="int" /> + <description> + Clears all cells on the given layer. + </description> + </method> <method name="fix_invalid_tiles"> <return type="void" /> <description> @@ -62,6 +69,13 @@ Returns the tile source ID of the cell on layer [code]layer[/code] at coordinates [code]coords[/code]. If [code]use_proxies[/code] is [code]false[/code], ignores the [TileSet]'s tile proxies, returning the raw alternative identifier. See [method TileSet.map_tile_proxy]. </description> </method> + <method name="get_coords_for_body_rid"> + <return type="Vector2i" /> + <argument index="0" name="body" type="RID" /> + <description> + Returns the coodinates of the tile for given physics body RID. Such RID can be retrieved from [member KinematicCollision2D.collider_rid], when colliding with a tile. + </description> + </method> <method name="get_layer_name" qualifiers="const"> <return type="String" /> <argument index="0" name="layer" type="int" /> @@ -220,6 +234,10 @@ <member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" default="16"> The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. </member> + <member name="collision_animatable" type="bool" setter="set_collision_animatable" getter="is_collision_animatable" default="false"> + If enabled, the TileMap will see its collisions synced to the physics tick and change its collision type from static to kinematic. This is required to create TileMap-based moving platform. + [b]Note:[/b] Enabling [code]collision_animatable[/code] may have a small performance impact, only do it if the TileMap is moving and has colliding tiles. + </member> <member name="collision_visibility_mode" type="int" setter="set_collision_visibility_mode" getter="get_collision_visibility_mode" enum="TileMap.VisibilityMode" default="0"> Show or hide the TileMap's collision shapes. If set to [code]VISIBILITY_MODE_DEFAULT[/code], this depends on the show collision debug settings. </member> |