From 75688772b3efadb8a36b1bb7ccde9c08819bc58e Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 29 Jun 2021 16:42:12 -0300 Subject: Fix editor suffixes and degrees conversion * Functions to convert to/from degrees are all gone. Conversion is done by the editor. * Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees. * Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:]" example "0,100,1,suffix:m" * In general, can add suffixes for EditorSpinSlider Not covered by this PR, will have to be addressed by future ones: * Ability to switch radians/degrees in the inspector for angle properties (if actually wanted). * Animations previously made will most likely break, need to add a way to make old ones compatible. * Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes. * Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too. --- doc/classes/@GlobalScope.xml | 48 +++++++++++++++++++--------------------- doc/classes/CanvasLayer.xml | 3 --- doc/classes/CharacterBody2D.xml | 3 --- doc/classes/CharacterBody3D.xml | 3 --- doc/classes/Control.xml | 3 --- doc/classes/EditorSpinSlider.xml | 3 +++ doc/classes/Node2D.xml | 8 ------- doc/classes/Node3D.xml | 5 +---- doc/classes/PhysicalBone3D.xml | 5 +---- doc/classes/Polygon2D.xml | 5 +---- 10 files changed, 29 insertions(+), 57 deletions(-) (limited to 'doc') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index d0e594a78b..daabc2c83b 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2410,74 +2410,72 @@ Hints that an integer or float property should be within a range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"-360,360,1,or_greater,or_lesser"[/code]. + Additionally, other keywords can be included: "exp" for exponential range editing, "radians" for editing radian angles in degrees, "degrees" to hint at an angle and "noslider" to hide the slider. - - Hints that an integer or float property should be within an exponential range specified via the hint string [code]"min,max"[/code] or [code]"min,max,step"[/code]. The hint string can optionally include [code]"or_greater"[/code] and/or [code]"or_lesser"[/code] to allow manual input going respectively above the max or below the min values. Example: [code]"0.01,100,0.01,or_greater"[/code]. - - + Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code]. - + Hints that a float property should be edited via an exponential easing function. The hint string can include [code]"attenuation"[/code] to flip the curve horizontally and/or [code]"inout"[/code] to also include in/out easing. - + Deprecated hint, unused. - + Deprecated hint, unused. - + Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like [code]"Bit0,Bit1,Bit2,,Bit4"[/code]. - + Hints that an integer property is a bitmask using the optionally named 2D render layers. - + Hints that an integer property is a bitmask using the optionally named 2D physics layers. - + Hints that an integer property is a bitmask using the optionally named 2D navigation layers. - + Hints that an integer property is a bitmask using the optionally named 3D render layers. - + Hints that an integer property is a bitmask using the optionally named 3D physics layers. - + Hints that an integer property is a bitmask using the optionally named 2D navigation layers. - + Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. - + Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. - + Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. - + Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. - + Hints that a property is an instance of a [Resource]-derived type, optionally specified via the hint string (e.g. [code]"Texture2D"[/code]). Editing it will show a popup menu of valid resource types to instantiate. - + Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. - + Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. - + Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. - + Hints that an image is compressed using lossy compression. - + Hints that an image is compressed using lossless compression. - + Hint that a property represents a particular type. If a property is [constant TYPE_STRING], allows to set a type from the create dialog. If you need to create an [Array] to contain elements of a specific type, the [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code] for specifying [Resource] types. For instance: [codeblock] hint_string = "%s:" % [TYPE_INT] # Array of inteters. diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index f4c04d7bca..eb99368079 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -39,9 +39,6 @@ The layer's rotation in radians. - - The layer's rotation in degrees. - The layer's scale. diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index fbe5c34d7d..b2d8aba174 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -101,9 +101,6 @@ Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. - - Maximum angle (in degrees) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. - If [code]true[/code], the body will be able to push [RigidBody2D] nodes when calling [method move_and_slide], but it also won't detect any collisions with them. If [code]false[/code], it will interact with [RigidBody2D] nodes like with [StaticBody2D]. diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index f6c3d68b3c..c76e02fac0 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -87,9 +87,6 @@ Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. - - Maximum angle (in degrees) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. - If [code]true[/code], the body will be able to push [RigidBody3D] nodes when calling [method move_and_slide], but it also won't detect any collisions with them. If [code]false[/code], it will interact with [RigidBody3D] nodes like with [StaticBody3D]. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 2692108d94..47e26b7a2e 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1144,9 +1144,6 @@ The node's rotation around its pivot, in radians. See [member rect_pivot_offset] to change the pivot's position. - - The node's rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot's position. - The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value. [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index 935335943f..b86e5e5c6e 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -18,6 +18,9 @@ + + The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed. + diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index cc99abf9cb..9ffa333f17 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -122,9 +122,6 @@ Global rotation in radians. - - Global rotation in degrees. - Global scale. @@ -137,16 +134,11 @@ Rotation in radians, relative to the node's parent. - - Rotation in degrees, relative to the node's parent. - The node's scale. Unscaled value: [code](1, 1)[/code]. - - Local [Transform2D]. diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 2dc8659d5d..14e03a2186 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -294,13 +294,10 @@ Local position or translation of this node relative to the parent. This is equivalent to [code]transform.origin[/code]. - + Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). [b]Note:[/b] In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. - - Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). - Scale part of the local transformation. diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml index 736b44ee1c..2ed862e9ce 100644 --- a/doc/classes/PhysicalBone3D.xml +++ b/doc/classes/PhysicalBone3D.xml @@ -66,12 +66,9 @@ Sets the joint's transform. - + Sets the joint's rotation in radians. - - Sets the joint's rotation in degrees. - Sets the joint type. See [enum JointType] for possible values. diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index c33a1424a7..5a53063148 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -118,12 +118,9 @@ Amount to offset the polygon's [code]texture[/code]. If [code](0, 0)[/code] the texture's origin (its top-left corner) will be placed at the polygon's [code]position[/code]. - + The texture's rotation in radians. - - The texture's rotation in degrees. - Amount to multiply the [code]uv[/code] coordinates when using a [code]texture[/code]. Larger values make the texture smaller, and vice versa. -- cgit v1.2.3