summaryrefslogtreecommitdiff
path: root/doc/classes/@GlobalScope.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/@GlobalScope.xml')
-rw-r--r--doc/classes/@GlobalScope.xml52
1 files changed, 41 insertions, 11 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index ea49b6b634..41cc043a74 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="@GlobalScope" version="4.0">
<brief_description>
- Global scope constants and variables.
+ Global scope constants and functions.
</brief_description>
<description>
- Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc.
+ A list of global scope enumerated constants and built-in functions. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc.
Singletons are also documented here, since they can be accessed from anywhere.
+ For the entries related to GDScript which can be accessed in any script see [@GDScript].
</description>
<tutorials>
+ <link title="Random number generation">$DOCS_URL/tutorials/math/random_number_generation.html</link>
</tutorials>
<methods>
<method name="abs">
@@ -248,9 +250,9 @@
- 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
+ - Between 0.0 to 1.0 (exclusive): Ease out
- 1.0: Linear
- - Greater than 1.0 (exclusive): Ease out
+ - Greater than 1.0 (exclusive): Ease in
[/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].
@@ -566,6 +568,26 @@
[b]Warning:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [code]value[/code] (in reality, 1 is the smallest integer power of 2).
</description>
</method>
+ <method name="pingpong">
+ <return type="float" />
+ <argument index="0" name="value" type="float" />
+ <argument index="1" name="length" type="float" />
+ <description>
+ Returns the [code]value[/code] wrapped between [code]0[/code] and the [code]length[/code]. If the limit is reached, the next value the function returned is decreased to the [code]0[/code] side or increased to the [code]length[/code] side (like a triangle wave). If [code]length[/code] is less than zero, it becomes positive.
+ [codeblock]
+ pingpong(-3.0, 3.0) # Returns 3
+ pingpong(-2.0, 3.0) # Returns 2
+ pingpong(-1.0, 3.0) # Returns 1
+ pingpong(0.0, 3.0) # Returns 0
+ pingpong(1.0, 3.0) # Returns 1
+ pingpong(2.0, 3.0) # Returns 2
+ pingpong(3.0, 3.0) # Returns 3
+ pingpong(4.0, 3.0) # Returns 2
+ pingpong(5.0, 3.0) # Returns 1
+ pingpong(6.0, 3.0) # Returns 0
+ [/codeblock]
+ </description>
+ </method>
<method name="posmod">
<return type="int" />
<argument index="0" name="x" type="int" />
@@ -703,6 +725,14 @@
[/codeblock]
</description>
</method>
+ <method name="randfn">
+ <return type="float" />
+ <argument index="0" name="mean" type="float" />
+ <argument index="1" name="deviation" type="float" />
+ <description>
+ Returns a normally-distributed pseudo-random floating point value using Box-Muller transform with the specified [code]mean[/code] and a standard [code]deviation[/code]. This is also called Gaussian distribution.
+ </description>
+ </method>
<method name="randi">
<return type="int" />
<description>
@@ -1231,7 +1261,7 @@
<constant name="INLINE_ALIGN_BOTTOM" value="14" enum="InlineAlign">
Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equvalent to [code]INLINE_ALIGN_BOTTOM_TO | INLINE_ALIGN_TO_BOTTOM[/code].
</constant>
- <constant name="SPKEY" value="16777216">
+ <constant name="KEY_SPECIAL" value="16777216" enum="Key">
Keycodes with this bit applied are non-printable.
</constant>
<constant name="KEY_ESCAPE" value="16777217" enum="Key">
@@ -1996,12 +2026,6 @@
<constant name="MOUSE_BUTTON_MIDDLE" value="3" enum="MouseButton">
Middle mouse button.
</constant>
- <constant name="MOUSE_BUTTON_XBUTTON1" value="8" enum="MouseButton">
- Extra mouse button 1 (only present on some mice).
- </constant>
- <constant name="MOUSE_BUTTON_XBUTTON2" value="9" enum="MouseButton">
- Extra mouse button 2 (only present on some mice).
- </constant>
<constant name="MOUSE_BUTTON_WHEEL_UP" value="4" enum="MouseButton">
Mouse wheel up.
</constant>
@@ -2014,6 +2038,12 @@
<constant name="MOUSE_BUTTON_WHEEL_RIGHT" value="7" enum="MouseButton">
Mouse wheel right button (only present on some mice).
</constant>
+ <constant name="MOUSE_BUTTON_XBUTTON1" value="8" enum="MouseButton">
+ Extra mouse button 1 (only present on some mice).
+ </constant>
+ <constant name="MOUSE_BUTTON_XBUTTON2" value="9" enum="MouseButton">
+ Extra mouse button 2 (only present on some mice).
+ </constant>
<constant name="MOUSE_BUTTON_MASK_LEFT" value="1" enum="MouseButton">
Left mouse button mask.
</constant>