Compare commits

...

233 Commits

Author SHA1 Message Date
Rémi Verschelde
7a0977ce2c Bump version to 4.0.2-stable 2023-04-04 00:43:56 +02:00
Rémi Verschelde
9099ac39cf i18n: Sync translations with Weblate 2023-04-04 00:33:24 +02:00
Rémi Verschelde
bd016c8c4d Merge pull request #75624 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 3rd batch
2023-04-04 00:18:49 +02:00
Yuri Sizov
0a8fdde924 Add changelog for 4.0.2 2023-04-03 19:18:55 +02:00
Araraura
d0e906327d Fix typo and slightly reword in @GDScript.xml
Fix "the every following property" to "then every following property" and change "is added" to "will be added".

(cherry picked from commit e1c0df7048)
2023-04-03 18:41:54 +02:00
kobewi
ed1eb1e18f Update UndoRedo description
(cherry picked from commit 3a06e6af76)
2023-04-03 18:41:05 +02:00
kobewi
1c66b24325 Fill random docs
(cherry picked from commit eac65fd0a8)
2023-04-03 18:40:24 +02:00
kleonc
103d23539f Improve CanvasItem.self_modulate docs
(cherry picked from commit 4fb9aa2294)
2023-04-03 18:39:37 +02:00
bruvzg
0c24ee363f [TextEdit] Fix block caret size at the end of the line.
(cherry picked from commit efe04af446)
2023-04-03 18:39:01 +02:00
skyace65
c114a7bab4 Remove reference to clipboard in OS class doc
(cherry picked from commit a65d99b541)
2023-04-03 18:38:27 +02:00
smix8
1deda0f003 Add navigation renames to 3to4 converter
Adds navigation renames to 3to4 converter.

(cherry picked from commit 0c1e585a1d)
2023-04-03 18:37:44 +02:00
kobewi
87929d9ab0 Add _get_configuration_warnings() example
(cherry picked from commit c4e08a4e1a)
2023-04-03 18:37:09 +02:00
Brennen Shaughnessy
040b432a12 Fixed property hint for platform layers on 3D physics body
(cherry picked from commit 2d16fe681d)
2023-04-03 18:36:27 +02:00
Paragoumba
b912905d23 Fix xml namespace in org.godotengine.Godot.xml
(cherry picked from commit 1ba14e838a)
2023-04-03 18:35:30 +02:00
smix8
e243dfa9f6 Fix NavigationAgent enable avoidance crash
Fixes NavigationAgent enable avoidance crash.

(cherry picked from commit 184427196f)
2023-04-02 17:37:12 +02:00
bruvzg
50f26811b0 [macOS] Fix infinite loop caused by global menu callbacks which trigger EditorProgress dialog.
(cherry picked from commit 48730e3b77)
2023-03-30 23:20:20 +02:00
Rémi Verschelde
c9ee508089 Bump version to 4.0.2-rc 2023-03-30 21:41:11 +02:00
Rémi Verschelde
b8b29c8566 Merge pull request #75500 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 2nd batch
2023-03-30 21:36:24 +02:00
Chris Hutchinson
4323c8b78b Replaced operating system alert dialog with a warning log message,
toggled by a project setting.
Fixes #73141

(cherry picked from commit cb8e919243)
2023-03-30 19:28:57 +02:00
Ninni Pipping
1e94881484 Exposing more project settings for documentation
(cherry picked from commit bd30847e59)
2023-03-30 19:26:05 +02:00
Haoyu Qiu
d6b36e800d Improve POT Generation dialog
* Avoid "property not found" warnings when adding a file for the first
  time.
* When no file is added, disable the Generate POT button instead of
  printing a warning.

(cherry picked from commit 584136271c)
2023-03-30 19:24:52 +02:00
Haoyu Qiu
ae0a98ef9b Hide internal settings from the classref
Default actions are no longer internal since we want to document them.
They are still hidden from the Project Setting dialog because we hid the
whole `input/` group manually.

(cherry picked from commit 1e0b8d6240)
2023-03-30 19:23:04 +02:00
Redwarx008
493e39860d C#: Fix Array.AddRange index out of bounds
Fix Array.AddRange index out of bounds

(cherry picked from commit eb1fb254a6)
2023-03-30 19:21:14 +02:00
Rémi Verschelde
fe71d33033 Project converter: Remove Tween properties/signals from renames
The Tween class in Godot 3 is fully incompatible with Godot 4, there's no point
doing these renames. It also makes it harder to use Threen, my (currently WIP)
forward-port of the Godot 3 Tween to Godot 4.

(cherry picked from commit 0171037e0a)
2023-03-30 19:20:36 +02:00
Mai Lavelle
9f20659c62 Fixups to list handling in SceneReplicationConfig
Wrong paths were being inserted leading to duplicates / missed properties.

(cherry picked from commit 74edbdd4bc)
2023-03-30 19:20:01 +02:00
Sabrehull
1056996200 [X11] Fix layout bug in keyboard_get_keycode_from_physical
(cherry picked from commit d4b7466266)
2023-03-30 19:19:23 +02:00
kobewi
74a35c9ca2 Don't allow selecting nodes without owner
(cherry picked from commit 2fcfef15da)
2023-03-30 19:18:35 +02:00
Bastiaan Olij
b39cbe71b4 Fix typo in OpenXR pose orientation check
(cherry picked from commit cdd9de28a8)
2023-03-30 19:17:55 +02:00
Danil Alexeev
07beae98f0 GDScript: Fix false positive REDUNDANT_AWAIT warning
(cherry picked from commit c0eeb32e38)
2023-03-30 19:17:15 +02:00
kleonc
47c4044d03 TileSet editor AtlasMergingDialog crash fix
(cherry picked from commit c72b09639a)
2023-03-30 19:16:33 +02:00
Brian Long
838a82f885 Update GPUParticles2D/3D speed scale on ENTER_TREE
Fix for https://github.com/godotengine/godot/issues/75218

Pause notifications are not sent when a node is added as a child. So GPUParticles2D should also obey its can_process status on ENTER_TREE, not just PAUSED/UNPAUSED.

(cherry picked from commit 4652fbd09e)
2023-03-30 19:15:47 +02:00
Fredia Huya-Kouadio
dc100cbebb Bump the target SDK version to 33 (Android 13)
(cherry picked from commit 845ca33c76)
2023-03-30 19:14:54 +02:00
lewiji
5f9990e25d Add "filesRoot" path to Android provider paths xml
(cherry picked from commit ac04ff7bec)
2023-03-30 19:13:59 +02:00
Fredia Huya-Kouadio
ff15e2384a Configure maven central snapshot versions for the Godot Android library
A snapshot version is a version that has not yet been released which allows us to deploy the same transient version incrementally, without requiring projects to upgrade the artifact version they're consuming. Those projects can use the same version to get an updated snapshot version.

(cherry picked from commit a5fdc95515)
2023-03-30 19:13:18 +02:00
fabriceci
bafc6372b2 Exposes the apply_floor_snap function to allow a snap to be made regardless of velocity.
(cherry picked from commit 1381e6da4f)
2023-03-30 19:10:45 +02:00
Yuri Sizov
19501f8eb1 Merge pull request #75397 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 1st batch
2023-03-27 20:14:47 +02:00
VolTer
843f5adbc5 Improve documentation of int
(cherry picked from commit 0f3197501e)
2023-03-27 18:06:47 +02:00
Hugo Locurcio
6fedc728f6 Use 8×8 default grid size for TextureRegion and 2D polygon editors
Power-of-two grid sizes are more suited to most game assets.

(cherry picked from commit 0f73ef1df9)
2023-03-27 18:04:25 +02:00
Haoyu Qiu
4750b77d2d Fix typos and inconsistencies in classref
* Typo fixes.
* Navigation agent's `velocity_computed` signal is not emitted by
  `set_velocity`, but at the end of that frame if `set_velocity` is
  called.
* Simplify link in navigation agent's `avoidance_enabled` description.
* Unify `navigation_layers` description across `NavigationAgent{2,3}D`.
* Unify `is_normalized()` description across `Vector2`, `Vector3`, and
  `Vector4`

(cherry picked from commit ff97c481d3)
2023-03-27 18:02:28 +02:00
Haoyu Qiu
2ea8dd7232 More i18n improvements
* Make placeholder in editor layout dialog translatable.
* Make messages in scene import settings dialog translatable.
* Mark theme override property categories for translation.

(cherry picked from commit 5a5fd33e42)
2023-03-27 18:02:14 +02:00
Haoyu Qiu
5e9e95c34c Make Add Scene button the same height as scene tabs
(cherry picked from commit 8ab11127bc)
2023-03-27 18:00:35 +02:00
Haoyu Qiu
50ea0951fe Fix height of subresource button in Inspector
(cherry picked from commit 66b325b728)
2023-03-27 18:00:28 +02:00
Ninni Pipping
7de181f524 Fix NodePath subname index range documentation
(cherry picked from commit c75870f798)
2023-03-27 17:59:43 +02:00
Unai Martinez-Corral
a08bee8d10 [ci/web] update mymindstorm/setup-emsdk to v12
(cherry picked from commit dcb974700b)
2023-03-27 17:59:08 +02:00
kobewi
65c52087c2 Remove disabled plugins from active plugins
(cherry picked from commit 0b8b37c35d)
2023-03-27 17:58:34 +02:00
Hugo Locurcio
b85cead4b9 Document how to use logarithm of base 10 with log()
(cherry picked from commit 3c4f0ca9c6)
2023-03-27 17:57:14 +02:00
Ninni Pipping
38595b8470 Fix "hides member" warnings in csharp_script.cpp
(cherry picked from commit ff5d8c4a42)
2023-03-27 17:56:20 +02:00
RedworkDE
adc7edd907 C#: Do not print errors about missing references to intentionally ignored members
(cherry picked from commit 42cf684837)
2023-03-27 17:55:32 +02:00
Ricardo Buring
9573574788 Port robust signal (dis)connection to ShapeCast2D
Ported from ShapeCast3D.

(cherry picked from commit 5bed055cdd)
2023-03-27 17:53:34 +02:00
Ricardo Buring
58d8368481 Fix collide_shape return type
Fix PhysicsDirectSpaceState3D::_collide_shape return type.
Also PhysicsDirectSpaceState2D::_collide_shape.

(cherry picked from commit 61429a5f49)
2023-03-27 17:50:35 +02:00
Ninni Pipping
2a52307936 Fix AnimatedSprite2D autoplay warning
Changing of autoplay when changing `SpriteFrames` is not done by the
user and warning is unhelpful

(cherry picked from commit 4d4342e018)
2023-03-27 17:49:44 +02:00
Ninni Pipping
9a4a0d042c Improve documentation for Area monitor callbacks in PhysicsServer3D
(cherry picked from commit 4124271241)
2023-03-27 17:49:05 +02:00
nikitalita
7a827f979e Fix ResourceImporterLayeredTexture::import() high_quality type
(cherry picked from commit 68a6505f41)
2023-03-27 17:48:02 +02:00
kleonc
b3f121d108 CanvasItem Fix ENTER_CANVAS / VISIBILITY_CHANGED notifications order when entering tree
(cherry picked from commit 6e3820fd4d)
2023-03-27 17:47:09 +02:00
Ninni Pipping
fa9f92112c Make Gradient resort points on reverse
(cherry picked from commit 3795677f3d)
2023-03-27 17:46:01 +02:00
ator-dev
9a3b52dc2d Fix "Download Project Source" for Web Editor
- Correctly pass safe project name and safe datetime to `vformat`

(cherry picked from commit dfb405b702)
2023-03-27 17:45:09 +02:00
Rindbee
ce4ab71957 Fix some wrong descriptions in the docs
(cherry picked from commit f29a7c0404)
2023-03-27 17:44:02 +02:00
bruvzg
989d556f8e [Windows] Remove meta_mem update on keyup/keydown.
(cherry picked from commit e6067a39b5)
2023-03-27 17:38:51 +02:00
Fredia Huya-Kouadio
9ac978190e Fix directory access when the running app has the All files access permission
(cherry picked from commit f02e4e4091)
2023-03-27 17:38:00 +02:00
kobewi
94e90b0593 Fix get_drag_data not overridable in some Controls
(cherry picked from commit 36141dc469)
2023-03-27 17:37:13 +02:00
Hugo Locurcio
9559bbcb18 Improve Color8 documentation
This documents in which situations Color8 is most suited and its
precision limitations.

(cherry picked from commit 4e4555bea5)
2023-03-27 17:35:47 +02:00
Mikael Hermansson
30a9b5fe9b Open up bounds of Shape3D.margin to support other physics engines
(cherry picked from commit ec6694ce3c)
2023-03-27 17:35:04 +02:00
Mikael Hermansson
465be40e10 Change documentation of Shape3D.margin to reflect current situation
(cherry picked from commit 33a6c80abb)
2023-03-27 17:34:59 +02:00
Dipal Zambare
47c3f44c0a Fix typo in the type-safe examples
Fix type in the type-safe examples of snapped, lerp and sign function.

(cherry picked from commit 8901986d56)
2023-03-27 17:33:49 +02:00
kleonc
8575010e88 TileMapEditor Fix preview rendering and transform calculations
(cherry picked from commit 224c66324b)
2023-03-27 17:32:48 +02:00
Patrick
9278da6f9b Fix ndc calculation for LinearSceneDepth VS node in GLES3
(cherry picked from commit e3802d5b6f)
2023-03-27 17:31:54 +02:00
Ninni Pipping
b43f847808 Fix Array.slice() rounding for abs(step) != 1
(cherry picked from commit 10f385fb79)
2023-03-27 17:31:05 +02:00
smix8
ac1b26c7c5 Fix agents with disabled avoidance getting added to avoidance simulation
Fixes that agents with disabled avoidance were getting added to avoidance simulation.

(cherry picked from commit 64ce93cee9)
2023-03-27 17:30:03 +02:00
Bastiaan Olij
f089782411 XR: When an sRGB target is used, check hardware sRGB conversion
(cherry picked from commit a1a52c5ba1)
2023-03-27 17:29:30 +02:00
smix8
dd94380b11 Fix GridMap signal "cell_size_changed" disconnect error
Fixes GridMap signal "cell_size_changed" disconnect error.

(cherry picked from commit d8bad3eef5)
2023-03-27 17:28:19 +02:00
smix8
22b5f0f608 Fix GridMap free navigation RID error spam
Fixes GridMap free navigation RID error spam.

(cherry picked from commit cc02007e30)
2023-03-27 17:27:27 +02:00
Fahad Shihab
e99b184b6c Added drag and drop support for shaderinclude
Dragging and dropping now works for shader include file.

(cherry picked from commit e5601b517e)
2023-03-27 17:26:36 +02:00
Ninni Pipping
7fe9c48e2b Fix type check for max/min
(cherry picked from commit c8c43997c7)
2023-03-27 17:23:58 +02:00
Zac Luzader
fcedf5dfdf OpenXR: Enable access to the Valve Index grip force sensing
(cherry picked from commit d3b26b3261)
2023-03-27 17:22:32 +02:00
RedworkDE
c0c5bdc510 Add dedicated setter for ImageTextureLayered::_images to fix create_from_images being hidden from the C# bindings
(cherry picked from commit f540148072)
2023-03-27 17:21:29 +02:00
Rémi Verschelde
516323f4ab SCons: Cleanup pulseaudio defines for Linux
No need to define _REENTRANT manually when using the system lib,
it's part of the pkgconfig cflags.
And we were then defining PULSEAUDIO_ENABLED twice.

(cherry picked from commit a35586779e)
2023-03-27 17:20:16 +02:00
Omar Polo
597b83aedf change some sys.exit() to be fatal
- when not all freetype deps are builtin (or provided externally)
- when attempting to build on an unsupported CPU architecture

(cherry picked from commit ac04a0761e)
2023-03-27 17:19:27 +02:00
Ninni Pipping
4da5fc9203 Fix Variant hashing for floats
Incorrectly hashed floats as single precision

(cherry picked from commit e6a9e0cdec)
2023-03-27 17:18:16 +02:00
Yuri Sizov
636d7905b0 Update property keying state without a full Inspector rebuild
(cherry picked from commit f68eb4a967)
2023-03-27 17:17:19 +02:00
Nong Van Tinh
e1de9f9fc4 Fixes  gutter set width results in receiving only half of the desired size
(cherry picked from commit bb3d0fc6b7)
2023-03-27 17:16:25 +02:00
Ron B. Yeh
b54ff430aa Rename mkv_list to mvk_list (MoltenVK path list).
(cherry picked from commit 7e7ac1bb87)
2023-03-27 17:15:28 +02:00
Marius Hanl
6e85d4efea Add conversion for Vector2 method tangent() -> orthogonal()
For C# also: Perpendicular() -> Orthogonal()

(cherry picked from commit da4ec87673)
2023-03-27 17:14:42 +02:00
Hakim
60ceecb1ab Reload built in script to get its methods on signal connection
(cherry picked from commit 5aa8b9ee61)
2023-03-27 17:13:30 +02:00
bruvzg
de08766656 Fix IME position in the single window mode sub-windows.
(cherry picked from commit 3ca3ee36ab)
2023-03-27 17:12:30 +02:00
kobewi
d91a3985ae Fix EditorUndoRedoManager's handling of MERGE_ENDS
(cherry picked from commit 38c50b4ed3)
2023-03-27 17:10:54 +02:00
Ricardo Buring
68e6234595 Fix concave/convex polygon shape documentation
Removes some outdated/incorrect/duplicated info, adds correct info.
Also removes no longer applicable "editor-only helper" statements.

(cherry picked from commit e61a127042)
2023-03-27 17:10:03 +02:00
stmSi
0dab32f317 Fix Find in Files Search Results cannot open builtin script
(cherry picked from commit f1f4c5b10b)
2023-03-27 17:06:43 +02:00
necrashter
865a0b4507 Use the new API for virtual keyboard height detection on Android, bugfix
(cherry picked from commit 61549edef0)
2023-03-27 17:05:13 +02:00
bitsawer
6782cd7291 Fix several clang-tidy bool literal conversion warnings
(cherry picked from commit 1736137bc9)
2023-03-27 17:03:22 +02:00
RedworkDE
bb5a6e29ab C#: Fix building projects for MSBuild before 17.3
(cherry picked from commit 6019f497b8)
2023-03-27 17:01:56 +02:00
Raul Santos
c4618bcc1b C#: Encode GodotProjectDir as Base64 to prevent issues with special characters
(cherry picked from commit f949e94991)
2023-03-27 17:01:32 +02:00
Yuri Rubinsky
a397474bd0 Fix randfn to prevent generating of nan values
(cherry picked from commit d11bb866ff)
2023-03-27 16:59:46 +02:00
VolTer
2e37c05fe6 Make GDScript number highlighting stricter
(cherry picked from commit 952703d921)
2023-03-27 16:58:50 +02:00
Pedro J. Estébanez
46d475b067 Fix crash in resource load
(cherry picked from commit 047671df0f)
2023-03-27 16:57:35 +02:00
Bastiaan Olij
a94a2062af Add XRServer.world_origin property
(cherry picked from commit fd8f26f26e)
2023-03-27 16:56:22 +02:00
bruvzg
7a3f8a83da Fix GDExtensions library export when multiple architectures are set.
(cherry picked from commit c2d678a924)
2023-03-27 16:55:28 +02:00
bruvzg
559d09c140 [TextServer] Add mutex for FreeType face creation/deletion operations.
(cherry picked from commit c950a1ab94)
2023-03-27 16:52:57 +02:00
LandoUWB
ff125a638a Commit Fix for GLES3 point size not working
(cherry picked from commit f23f0a27c1)
2023-03-27 16:51:10 +02:00
RandomCatDude
149f16b2fa fix spotlight shadows in volumetric fog
(cherry picked from commit 59c31004f8)
2023-03-27 16:47:46 +02:00
Michael Alexsander
bf8ab62ca3 Fix GraphNode resizing when its bottom border is too thin
(cherry picked from commit c567a853db)
2023-03-27 16:45:22 +02:00
myaaaaaaaaa
6ed9e03449 Fix data races in startup/teardown
(cherry picked from commit d337ed1c64)
2023-03-27 16:43:47 +02:00
bruvzg
db3fadc560 Improve layout direction/locale automatic selection.
(cherry picked from commit 82d7923c65)
2023-03-27 16:36:53 +02:00
bruvzg
24c4b5e8ad [macOS] Re-add support for the _sc_ inside app bundle. Update docs.
(cherry picked from commit 174e0837e0)
2023-03-27 16:34:57 +02:00
Markus Sauermann
3cae980c17 Fix some ways to create inconsistent Viewport sizes
In the editor, it was possible to set the size of a `SubViewport` even
in cases where a parent `SubViewportContainer` had stretch enabled.

This PR disables editing a `SubViewport.size` while the parent disallows
it and it makes necessary adjustments during `NOTIFICATION_ENTER_TREE`.

(cherry picked from commit 34a7fc7447)
2023-03-27 16:34:05 +02:00
LandoUWB
34a087cc2c Incorporating the availability of screen and depth textures for the GLES3 backend
(cherry picked from commit 98697b05d8)
2023-03-27 16:32:25 +02:00
Eric M
74b5a0ca4f Fix cancelling selection (pressing escape) while gizmo editing making uncommitted changes.
* Pressing escape while gizmo editing will discard the changes made during that edit 'session'

(cherry picked from commit 871ddf80c0)
2023-03-27 16:29:21 +02:00
Paweł
ca0ba83f03 Fix scrolling behaviour with low page value
(cherry picked from commit 1608bea188)
2023-03-27 16:28:29 +02:00
clayjohn
5262fe21de Delete unused compression formats from .imoprt files when exporting
(cherry picked from commit dec86164e1)
2023-03-27 16:26:13 +02:00
Ricardo Buring
d8f0c2bdca Revert attempted fix of trimesh CCD
(cherry picked from commit bec1182093)
2023-03-27 16:22:22 +02:00
Rémi Verschelde
cacf49999e Bump version to 4.0.1-stable 2023-03-19 18:03:00 +01:00
Rémi Verschelde
c5aa3bd7d7 Merge pull request #75097 from YuriSizov/4.0.1-changelog
Add changelog for 4.0.1
2023-03-19 09:59:29 -07:00
Yuri Sizov
ac8f97048e Add changelog for 4.0.1 2023-03-19 12:32:10 +01:00
Rémi Verschelde
6970257cff Merge pull request #74987 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 4th batch
2023-03-16 10:44:56 -07:00
lawnjelly
c0e5879b41 Improve Vector2 / 3 / 4 normalized() classref.
Mention that the results will be unreliable with initial vector near zero.

(cherry picked from commit cca01afd82)
2023-03-16 16:46:18 +01:00
smix8
8e8ecf52cf Fix NavigationAgent3D debug path duplicated points
Fixes duplicated points in NavigationAgent3D debug path.

(cherry picked from commit 0b8798a995)
2023-03-16 16:45:16 +01:00
smix8
bea2da94da Allow negative NavigationAgent2D path debug line_width for thin lines
Allows the line_width for NavigationAgent2D path debug to go negativ for thin line rendering.

(cherry picked from commit f6a10c0565)
2023-03-16 16:45:07 +01:00
Haoyu Qiu
c6a704af2c Fix typos and inconsistencies in classref
(cherry picked from commit 57d4272984)
2023-03-16 16:43:31 +01:00
Haoyu Qiu
ef06e5d786 Fix error when opening Inspector's dots menu
When the inspector is empty, opening the "extra resource options" menu
produces a error:

> Condition "current_res.is_null()" is true.

Opening the mneu with no current resource is valid use case, so
`ERR_FAIL_COND` should not be used.

(cherry picked from commit cb0fa0ed7b)
2023-03-16 16:42:53 +01:00
clayjohn
ec5f503289 Disallow creating a project in the Home or Documents folder
Also don't prompt users to delete the project folder for now.

This is a temporary fix to ensure that users do not delete their entire home folders by mistake

(cherry picked from commit 45a26ff292)
2023-03-16 16:42:09 +01:00
Hugo Locurcio
ab12edb6c6 Add "Bbcode" -> "BBCode" editor capitalization
This property name is used in RichTextLabel.

(cherry picked from commit 81858da2e6)
2023-03-16 16:41:16 +01:00
kobewi
5faebb712e Fix MultiNodeEdit not cleared after deleting nodes
(cherry picked from commit fbffd686e2)
2023-03-16 16:40:13 +01:00
Brett Chalupa
1507bea80c Fix CharacterBody2D get_slide_collision docs
The indentation was off and the code usage was incorrect for Godot 4.0 GDScript.

(cherry picked from commit 2b6e1550ff)
2023-03-16 16:39:23 +01:00
David Snopek
1c7bd972e4 Documents the "arc-based" Quaternion constructor
(cherry picked from commit 2d6deb10b0)
2023-03-16 16:38:47 +01:00
Marius Hanl
3bb89a0911 Add conversion for common Theme Overrides
(cherry picked from commit a40f559fe2)
2023-03-16 16:37:38 +01:00
Danil Alexeev
5acc7a77fe Fix InputEventConfigurationDialog modifies original event
(cherry picked from commit 9fbf24fd5c)
2023-03-16 16:37:05 +01:00
bruvzg
577afedc40 [macOS] Remove unnecessary debug prints.
(cherry picked from commit 42a30c76d9)
2023-03-16 16:35:54 +01:00
Rémi Verschelde
d23922ffeb i18n: Sync translations with Weblate 2023-03-15 02:29:27 +01:00
Yuri Sizov
fc7adaab7b Merge pull request #74907 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 3rd batch
2023-03-14 16:00:02 +01:00
the-sink
38c0ad7c6c Redraw 2d viewport when guides are cleared
(cherry picked from commit 0c051f41b1)
2023-03-14 13:59:05 +01:00
pcamp
0cf5de8f19 Fix typo in Window class.
"event as" -> "events will be"

(cherry picked from commit 112977be26)
2023-03-14 13:59:05 +01:00
Marius Hanl
3176016528 Convert OpenSimplexNoise to FastNoiseLite
- class name and octaves property

(cherry picked from commit 862296273b)
2023-03-14 13:59:05 +01:00
Yuri Sizov
c59c68cdec Make sure Script Debugger is updated with the editor theme
(cherry picked from commit 239eb31c90)
2023-03-14 13:59:05 +01:00
clayjohn
5f6a534569 Use linear filtering without mipmaps for ProceduralSkyMaterial and PhysicalSkyMaterial
(cherry picked from commit 572ac91514)
2023-03-14 13:59:05 +01:00
justchen1369
59a78ecf5a Fix exported type for Menubar start_index
(cherry picked from commit dbfecdb3b0)
2023-03-14 13:59:04 +01:00
Dmitrii Maganov
23f2c1234c GDScript: Fix autocomplete inside a block with a type test condition
(cherry picked from commit e289a4ab2c)
2023-03-14 13:59:04 +01:00
yedpodtrzitko
5824967f2f clear filter input in Project Settings when opening Layers
(cherry picked from commit e13bcf5b84)
2023-03-14 13:59:04 +01:00
Mikael Hermansson
7ac80569b3 Fix extension bindings for motion collision/result structs
(cherry picked from commit be64ffd25d)
2023-03-14 13:59:04 +01:00
Haoyu Qiu
38ad9c52b2 Add missing TTRs in tiles editor and array inspector
(cherry picked from commit bef7f14885)
2023-03-14 13:59:04 +01:00
Rémi Verschelde
9e5e6568b7 Vulkan: Fix VMA build with GCC 13
Fixes #74647.

(cherry picked from commit b113e6d4ff)
2023-03-14 13:59:04 +01:00
Hayden Leete
26ab941507 Fix errors when closing floating docks
dock->get_index() on line 4463 was not behaving as expected
due to dock having an internal sibling, so now we just get the
index excluding internal nodes.

line 4742 would throw an error if you made multiple docks
floating then redocked the end docks first, but no longer

(cherry picked from commit 21578e0bb4)
2023-03-14 13:59:04 +01:00
Hugo Locurcio
10424abb29 Tweak command syntax in Vulkan renderer failure message
This quotes the executable name so that copying it always works
(even if the path contains spaces).

The command is also indented from the rest of the text and is
no longer single-quoted, as that can prevent the command from
running if the line is copied in its entirety (with the quotes).

(cherry picked from commit ddc9cc3e49)
2023-03-14 13:59:04 +01:00
Chris Weber
006410ae46 increased max touches to 32 for ios
(cherry picked from commit 54bd204377)
2023-03-14 13:59:04 +01:00
Hugo Locurcio
e79477a4b5 Document using String.uri_encode() with OS.shell_open()
(cherry picked from commit 81ac3c3e71)
2023-03-14 13:59:04 +01:00
bruvzg
0c1abbd79e [Linux/X11] Add some missing keycodes/scancodes.
(cherry picked from commit 5d35c600d5)
2023-03-14 13:59:04 +01:00
VolTer
5ae484c138 Fix error spam when naming a func at the end of the script
(cherry picked from commit 07dd627728)
2023-03-14 13:59:03 +01:00
RedworkDE
f9bb1d3174 Fix buffer overrun in CPUParticles3D
(cherry picked from commit 89980dd9c9)
2023-03-14 13:59:03 +01:00
Haoyu Qiu
b4a1bfd6d5 Fix coloring of the renderer options button
(cherry picked from commit ac7a4f6e87)
2023-03-14 13:59:03 +01:00
Johan Aires Rastén
4ff705b37e Fix instance uniforms breaking when setting a new mesh.
Fixes #58113

(cherry picked from commit 26aecbfe57)
2023-03-14 13:59:03 +01:00
Ryan Roden-Corrent
47dc4bc307 Don't unset local_coords on starting transform.
This fixes a bug introduced by 806425621c, where dragging the gizmo no longer respected local transforms.

I'm not sure why I called set_local_coords_enabled(false) in _compute_edit. Removing this line seems to fix gizmo-dragging local transforms, without breaking anything else.

I also noticed that confirming a transform leaves the gizmo axis lines on the screen. This is fixed by calling update_transform_gizmo after clearing the edit mode/instant flags, so update_transform_gizmo knows not to render any axes.

(cherry picked from commit d3d1223b97)
2023-03-14 13:59:03 +01:00
clayjohn
08845dc3f0 Propogate errors when creating an OpenGL context fails in X11
(cherry picked from commit e7ea3ef531)
2023-03-14 13:59:03 +01:00
SlugFiller
d508d0a642 Fixes a canvas item set to clip children being drawn as black if no children are visible
(cherry picked from commit f25508befb)
2023-03-14 13:59:03 +01:00
SlugFiller
18bf2663f9 Fix AABB calculation for meshes using Skeleton2D
(cherry picked from commit 06a1fe0364)
2023-03-14 13:59:03 +01:00
Johan Aires Rastén
d229ca2f27 Fixed incorrect ERROR message when setting new PrimitiveMesh
If calling set_mesh with a PrimitiveMesh that has pending update, the
_mesh_changed function would be called twice. The first time before
set_base had been called, which could lead to an ERROR message about
trying to set an invalid surface override material.

(cherry picked from commit 007b488a5c)
2023-03-14 13:59:03 +01:00
Ryan Roden-Corrent
89a40d317d Disable local space for blender transforms.
Having local_space enabled when starting a transform changed the
behavior of VIEW space transforms. Now we disable local_space when
starting a blender transform (there was already logic to restore the
setting after the transform ends).

This also hides the gizmo while performing a blender transform,
otherwise the user will see it snap back and forth between the local and
global alignment. I think the transform looks cleaner with the gizmo
hidden anyways.

Fixes #59392.

(cherry picked from commit 806425621c)
2023-03-14 13:59:03 +01:00
Rindbee
323c3f80c5 Fix broken shortcut key input
(cherry picked from commit 91e460d500)
2023-03-14 13:59:03 +01:00
Jakub Mateusz Marcowski
5a7624e50f Modify JSON.stringify so that it doesn't create unnecessary empty lines from empty arrays
(cherry picked from commit 0a55a32085)
2023-03-14 13:59:03 +01:00
Rémi Verschelde
7e74568709 FBX: Disable importer when canceling FBX2glTF setup
Pretty hacky solution but it's better than an infinite loop.

All this import setup needs to be redone, it's very difficult to properly
bail out from an invalid import without triggering reimport loops.

Also fix underline not visible at default editor scale in LinkButton.

Fixes #73319.

(cherry picked from commit d81e6ee024)
2023-03-14 13:59:02 +01:00
clayjohn
278fc7538d Avoid overflow when calculating ptr address for 3D textures in RenderingDevice texture update
(cherry picked from commit 06042a23b6)
2023-03-14 13:59:02 +01:00
Yuri Sizov
258ea41ffa Merge pull request #74884 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 2nd batch
2023-03-14 13:57:36 +01:00
Yuri Sizov
84e9a79ace Add missing handler for removing font sizes in Themes
(cherry picked from commit 5a3dbea3ed)
2023-03-13 22:22:05 +01:00
clayjohn
a41a813af4 Set properties of ImageTexture3D when creating
(cherry picked from commit e9d80a821d)
2023-03-13 22:20:32 +01:00
juliuse98
e3e117cac5 Fix blend-file import when using custom color management in blender
When using custom color management in blender the --version command will
output additional information infront of the "normal" output and this
prevented the import.

Fixes #74439.

(cherry picked from commit 7a0d12182e)
2023-03-13 22:19:36 +01:00
bruvzg
494449f212 [TextServer] Fix justification on punctuation characters.
(cherry picked from commit 016b2f3555)
2023-03-13 22:18:04 +01:00
smix8
069c48bfdc Fix NavigationServer free error print
Fixes error print for NavigationServer free when a RID can not be found.

(cherry picked from commit 73dc680fc1)
2023-03-13 22:12:27 +01:00
Ninni Pipping
75e078d885 Fix type icons in PropertySelector
And adding a check to prevent future issues.

(cherry picked from commit ca86d53e7f)
2023-03-13 22:11:46 +01:00
Thomas Lobig
a755ac856a remove incorrect rename of get_used_cells_by_id
renaming get_used_cells_by_id to get_used_cells is not only unecessary, it introduces hard to debug issues

(cherry picked from commit d6a2197b3d)
2023-03-13 22:10:04 +01:00
bruvzg
34c909b41e [TextEdit] Do not draw virtual spaces (word break / justification points).
(cherry picked from commit 25bc62ad13)
2023-03-13 22:09:27 +01:00
Rémi Verschelde
b1c8a40853 Windows: Workaround missing DWRITE_FONT_WEIGHT value in old MinGW
Fixes #74339.

(cherry picked from commit b7ecb9584a)
2023-03-13 22:06:14 +01:00
Hakim
90dbf3bd38 Get the unlit / unshaded extension when importing GLTF and set it when exporting
(cherry picked from commit e14fa5532b)
2023-03-13 22:05:07 +01:00
bruvzg
4cce358241 [Windows] Update modifier key status during IME input.
(cherry picked from commit ba995c6ea1)
2023-03-13 22:04:08 +01:00
bruvzg
ef3f1d426d [Web] Fix some missing keycode mappings.
(cherry picked from commit 0b0587af97)
2023-03-13 22:00:15 +01:00
clayjohn
bc6743c96d Add proper default texture filter and repeat modes for Canvas shaders in the OpenGL3 renderer
(cherry picked from commit 46b416f3b1)
2023-03-13 21:58:51 +01:00
Haoyu Qiu
050ec70ea4 Notify child controls when BackBufferCopy's rect changed
(cherry picked from commit 602a0d2fbc)
2023-03-13 21:57:20 +01:00
RedworkDE
20eeb7c66d C#: Get singleton instances using the Core name
(cherry picked from commit 16a2a164fe)
2023-03-13 21:56:31 +01:00
Raul Santos
ad6fa1cd25 C#: Ignore explicit interface implementations
(cherry picked from commit 0372bd56b6)
2023-03-13 21:55:11 +01:00
Dmitrii Maganov
079c8ea719 GDScript: Fix checking if a call is awaited in compiler
(cherry picked from commit 55a2ad25bf)
2023-03-13 21:54:05 +01:00
Aleks Rutins
782e1fe84e Validate that C# class names are valid identifiers
(cherry picked from commit ae8752a731)
2023-03-13 21:52:44 +01:00
Fabio Iotti
01324f025a Error on hint_normal_roughness_texture and hint_depth_texture outside of spatial shader
(cherry picked from commit 528e0d095e)
2023-03-13 21:51:36 +01:00
Rémi Verschelde
c6f7675b1f Linux: Don't try to link system embree3 on unsupported archs
(cherry picked from commit afb8693715)
2023-03-13 21:49:15 +01:00
Bastiaan Olij
c8f64c68a5 Use MSAA 2D texture in multipass tonemapper
(cherry picked from commit 903aa0e385)
2023-03-13 21:48:02 +01:00
kobewi
4e90cc55ec Check for type mismatch in PropertyTweener.from()
(cherry picked from commit 45f4d59fa4)
2023-03-13 21:45:34 +01:00
clayjohn
925381201b Add a few more rendering timestamps
(cherry picked from commit 1adc4e5875)
2023-03-13 21:43:38 +01:00
bruvzg
48a639f4a5 [Bitmap font] Assume outline size is 1 if it's not set, but channel for outline is defined.
(cherry picked from commit 67762ec4a6)
2023-03-13 21:41:21 +01:00
bruvzg
57dc060879 Fix Windows to Windows SSH remote deploy. Fix Windows execute exit code.
(cherry picked from commit 94355249c3)
2023-03-13 21:37:41 +01:00
Arman Elgudzhyan
7e6bc72f7c Don't autocomplete numbers in GDScript
Cancel code autocompletion when a numerical value is entered. Avoids interference when setting numbers.

(cherry picked from commit 688d00b706)
2023-03-13 21:35:23 +01:00
clayjohn
13b37a50ae Add parentheses around arguments when converting xform
(cherry picked from commit 3ee5fbdb73)
2023-03-13 21:33:35 +01:00
Ryan Roden-Corrent
81f4996683 Add some missing renames to 3to4 tool.
MultiplayerPeerExtension isn't an exact replacement for
NetworkedMultiplayerCustom, but at least it gets you moving in the right direction.

Engine.editor_hint couldn't be fixed by the renames map, because you have to add a `()` at the end.

(cherry picked from commit 6b17c2b6e7)
2023-03-13 21:32:51 +01:00
Ryan Roden-Corrent
06e2c6ace2 Move tool declarations to top in 3to4.
In godot3, `tool` can follow keywords like `extends` and `class_name`
In godot4, `@tool` must be the first line in the file.

(cherry picked from commit 9a474fb99f)
2023-03-13 21:31:53 +01:00
Marius Hanl
9fff0fcbb5 Project Converter: Do not convert lines that start with a comment
Lines that start with # or // are ignored

(cherry picked from commit 8cf7ac3a45)
2023-03-13 21:31:23 +01:00
Ninni Pipping
f6709a1fda Add keycode project conversion
(cherry picked from commit fec630f360)
2023-03-13 21:28:58 +01:00
Marcus Elg
6041ad5c70 Fix Camera2D position smoothing properties not being grouped
(cherry picked from commit a835dfd96d)
2023-03-13 21:25:14 +01:00
Ryan Roden-Corrent
6cd227a35c Correct superclass constructors in 3to4.
Fixes #70542.

The 3to4 conversion tool was not handling superclass constructors.
We should translate the godot3 syntax:

```gdscript
func _init(a,b,c).(a,b,c):
    pass

func _init(a,b,c):
    super(a,b,c)
```

Originally, the _init conversion was intended to remove `void` return types from _init functions, as this was disallowed due to #50589.
As that was resolved by #53366, I removed that part of the conversion logic. If a void return type is present on a constructor, the converter now leaves it.

Here's a sample diff from my own project:

```diff
@@ -103,10 +105,11 @@ class Real:
 class Text:
        extends Setting

-       var choices: PoolStringArray
-       var value: String setget set_value, get_value
+       var choices: PackedStringArray
+       var value: String : get = get_value, set = set_value

-       func _init(section: String, key: String, default: String, choice_list: Array).(section, key, default) -> void:
+       func _init(section: String, key: String, default: String, choice_list: Array) -> void:
+               super(section, key, default)
                choices = choice_list

        func normalize(val):
@@ -129,9 +132,10 @@ class Text:
 class Boolean:
        extends Setting

-       var value: bool setget set_value, get_value
+       var value: bool : get = get_value, set = set_value

-       func _init(section: String, key: String, default: bool).(section, key, default) -> void:
+       func _init(section: String, key: String, default: bool) -> void:
+               super(section, key, default)
                pass
```

(cherry picked from commit 53a00abb11)
2023-03-13 21:19:53 +01:00
Ryan Roden-Corrent
1421838ba7 Don't strip whitespace when converting 3to4.
Fixes #74204.

The style guide says

> Always use one space around operators and after commas

The 3to4 conversion tool currently strips space in certain scenarios.
I've updated it to add space whenever it is generating new code.
In any case where it substitutes existing code, it leaves it as-is.

For example, connect(a,b,c) becomes `connect(a, callable(b, c))`, because the converter is adding new commads/parens.

However, `xform(Vector3(a,b,c))` becomes `Transform * Vector3(a,b,c)` because it uses the user's original Vector3 string whole. If the user originally had `xform(Vector3(a, b, c))`, then it becomes `Transform * Vector3(a, b, c)`.

Ideally we'd always preserve original formatting, but this seems quite difficult, so I tried to preserve it where we can, but air on the side of following the style guide whenever we're transforming code.

(cherry picked from commit d3684e662f)
2023-03-13 21:18:53 +01:00
Yuri Sizov
30e81fcc26 Merge pull request #74866 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 1st batch
2023-03-13 16:58:31 +01:00
Ninni Pipping
857cd853de Fix TileSetEditor paiting texture_origin Vector2i
(cherry picked from commit fb317546fe)
2023-03-13 14:52:22 +01:00
Raul Santos
1640b1a150 C#: Always show "Create C# solution" option
Prevents ending up with an empty C# menu.
The option to create the C# solution no longer disappears, to avoid confusing users.
If an user tries to use it when a C# solution already exists they are warned that it will override their sln and csproj files.

(cherry picked from commit a1a2fc2255)
2023-03-13 14:50:57 +01:00
Haoyu Qiu
093d237138 Fix dock name lost translation after layout change
* After you click in the dock select panel
* After you load an editor layout

(cherry picked from commit 43bf0ca8d2)
2023-03-13 14:49:17 +01:00
bruvzg
764fe8ac51 Automatically reparent editor message dialogs to avoid error spam.
(cherry picked from commit 921f3b7589)
2023-03-13 14:48:33 +01:00
SaracenOne
d929784491 Stop toaster notification circle flickering when notifications are all hidden.
(cherry picked from commit ab61624c78)
2023-03-13 14:47:14 +01:00
Niels Drost
94db7f866b TileSet editor was out of sync with TileMap and incorrectly overwrote old selected TileSet after an edit call with a null pointer.
(cherry picked from commit 66374c8dce)
2023-03-13 14:45:26 +01:00
Danil Alexeev
f4ea9df0f4 Fix GDScript code style regarding colon
(cherry picked from commit ea5fd3d732)
2023-03-13 14:42:27 +01:00
Isaac Clerencia
acdb1bdbd7 Clarify Thread documentation
The current documentation uses the term "running" for two different things.

In the description of get_id() it claims "it will return empty string if the thread is not running", but it actually will return the thread id until wait_to_finish is called.

In the description of is_alive() it claims "it will return true if the thread is running", but in this case it means "the provided function hasn't finished running yet".

Updated the functions documentation slighly to make this clear.

(cherry picked from commit 2a4f38d54f)
2023-03-13 14:41:26 +01:00
Aaron Franke
9e6f0ee9c7 Document GLTFNode and some of GLTFState
(cherry picked from commit 2cc22fb964)
2023-03-13 14:40:30 +01:00
BrunoSXS
3aa3fb8771 Fix for AABB methods with wrong description
(cherry picked from commit df0de07494)
2023-03-13 14:38:17 +01:00
kobewi
9997250051 Discourage reusing Tweens
(cherry picked from commit 9785b23a0a)
2023-03-13 14:34:08 +01:00
themancalledjakob
e043484d36 improve documentation for Font and FontVariation
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit fb5c2d9f75)
2023-03-13 14:33:24 +01:00
Andreas Raddau
a026669cc5 Fixed minor typo in turbulence documentation
(cherry picked from commit c618f9fce2)
2023-03-13 14:30:21 +01:00
kobewi
4bd16e6493 Safeguard Makefile commands
(cherry picked from commit d29030fdd0)
2023-03-13 14:29:23 +01:00
JustKoi
ed139593bf Fix small mistake in Window.xml
Fix small mistake in Window.xml

(cherry picked from commit 7f8425d6fb)
2023-03-13 14:28:35 +01:00
George Marques
b880bde10f Remove outdated note about const in Dictionary and Array docs
(cherry picked from commit d2b1d6e69b)
2023-03-13 14:27:48 +01:00
Haoyu Qiu
80cde341d4 Fix various typos in the classref
(cherry picked from commit 03fcac3aa5)
2023-03-13 14:27:06 +01:00
titus125
8732a8af47 Fixed typos in the Transform2D and Transform3D class reference
(cherry picked from commit 36270d39d2)
2023-03-13 14:26:29 +01:00
Ninni Pipping
8dca093d97 Document editor/naming/scene_name_casing setting
Moved definitions of editor related project settings to `editor/register_editor_types.cpp` to make documentation work.

(cherry picked from commit 3de5332fcb)
2023-03-13 14:25:46 +01:00
Malcolm Nixon
5180116c07 Fix null-pointer dereference on Android systems when using gl_compatibility renderer.
(cherry picked from commit d186b7438f)
2023-03-13 14:22:45 +01:00
RedworkDE
0112862e70 C#: Fix crash when errors occur before language initialization.
(cherry picked from commit c0ebc28136)
2023-03-13 14:21:06 +01:00
Yuri Sizov
234c601a61 Improve logic related to editing audio buses (and prevent crashes)
(cherry picked from commit 68c18c0e2b)
2023-03-13 14:19:41 +01:00
Yuri Sizov
3c2e952889 Prevent crashing on startup if project has scripted theme types
Also avoid order of operation conflicts by moving C# binding generation hook to main.cpp

(cherry picked from commit 8402927d3f)
2023-03-13 14:18:32 +01:00
bruvzg
d83245f2f9 [TextServer] Add invalid font scaling check, restrict Linux/BSD system fonts lookup to TrueType/CFF only.
(cherry picked from commit 8d501a2dc3)
2023-03-13 14:17:42 +01:00
Yuri Sizov
048c252602 Prevent cache corruption when saving resources in the editor
(cherry picked from commit 496bd94c21)
2023-03-13 14:16:13 +01:00
Hayden Leete
7490f89238 Fix crash when revealing file in floating FileSystem Dock
When selecting "Show in FileSystem" from the context menu of a resource
in the inspector, the engine would crash if the FileSystem dock was
floating because it was trying to focus the FileSystem tab, but floating
docks don't use Tab Containers. This commit makes the FileSystem dock's
window grab focus instead if it's floating.

(cherry picked from commit c4d1513e15)
2023-03-13 14:15:18 +01:00
Paweł Fertyk
41f4068a6e Fix RichTextLabel crash with out of bound exception
Fixes #68242.

(cherry picked from commit 44592c8c19)
2023-03-13 14:13:36 +01:00
Yuri Sizov
755a86f502 Generate empty textures for theme icons if the SVG module is disabled
(cherry picked from commit 64215ad119)
2023-03-13 14:12:44 +01:00
Haoyu Qiu
2d0d07f51b Fix crash when dumping extension API in a non-writable directory
(cherry picked from commit 49400e0c1c)
2023-03-13 14:11:24 +01:00
clayjohn
5662542526 Avoid copying CanvasTexture when updating proxy
(cherry picked from commit 84482ef90b)
2023-03-13 14:10:38 +01:00
bruvzg
1d21652f80 [Linux/X11] Check if required xkb functions exist before using it.
(cherry picked from commit 8a675f3824)
2023-03-13 14:08:31 +01:00
Nicholas Huelin
f55c61d601 Modify the default theme GraphNode close_h_offset
Modifies the close_h_offset to be 12 instead of 22. This better aligns the default position.

(cherry picked from commit 961d6763fb)
2023-03-13 14:06:08 +01:00
bruvzg
466d226a4a [TextServer] Ensure ICU data is initialised only one and cleaned only at exit.
(cherry picked from commit 7f24433e15)
2023-03-13 14:04:41 +01:00
Abdulrahman Al Zeidi
e290448fe3 Fix glTF mesh importer not freeing nodes correctly on import
(cherry picked from commit 5e0641ea9a)
2023-03-13 14:00:38 +01:00
Yuri Sizov
eb503fb461 Merge pull request #74750 from YuriSizov/project-manager-lighten-up-4.0
[4.0] Ensure that editor color map is initialized in the project manager
2023-03-13 13:48:33 +01:00
Yuri Sizov
671f8eb790 Ensure that editor color map is initialized in the project manager 2023-03-11 02:04:54 +01:00
Haoyu Qiu
17a130cbd1 Fix "Convert Full Project" button not translated
Also fixes a typo in the CHANGELOG.

(cherry picked from commit e03bfd6f7f)
2023-03-06 10:10:02 +01:00
Rémi Verschelde
47114a77f8 CI: Pin SCons to 4.4.0, the new 4.5.0 is broken
(cherry picked from commit 85bb561713)
2023-03-06 10:08:43 +01:00
Rémi Verschelde
284a1b6a6e Bump version to 4.0.1-rc 2023-03-01 14:09:30 +01:00
382 changed files with 87707 additions and 4981 deletions

View File

@@ -23,5 +23,5 @@ runs:
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python -m pip install scons==4.4.0
scons --version

View File

@@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v11
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

View File

@@ -4,6 +4,383 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [4.0.2] - TBD
See the [release announcement](https://godotengine.org/article/maintenance-release-godot-4-0-2) for details.
### Added
#### Core
- Add a missing `ImageTextureLayered::_images` setter for the C# bindings ([GH-74668](https://github.com/godotengine/godot/pull/74668)).
- Exposing more project settings for documentation ([GH-74727](https://github.com/godotengine/godot/pull/74727)).
#### Physics
- Expose the `apply_floor_snap` function to allow manual snap ([GH-73749](https://github.com/godotengine/godot/pull/73749)).
#### Porting
- Android: Use the new API for virtual keyboard height detection on Android, bugfix for old API ([GH-74398](https://github.com/godotengine/godot/pull/74398)).
- Android: Configure maven central snapshot versions for the Godot Android library ([GH-74470](https://github.com/godotengine/godot/pull/74470)).
- Android: Add "filesRoot" path to Android provider paths xml ([GH-74673](https://github.com/godotengine/godot/pull/74673)).
- macOS: Re-add support for the `_sc_` inside app bundle. ([GH-73429](https://github.com/godotengine/godot/pull/73429)).
#### Project converter
- Add conversion for `Vector2` `tangent()` -> `orthogonal()` ([GH-74515](https://github.com/godotengine/godot/pull/74515)).
- Add navigation renames to the converter ([GH-75513](https://github.com/godotengine/godot/pull/75513)).
#### Shaders
- Add drag and drop support for shader include files in shader editor ([GH-74869](https://github.com/godotengine/godot/pull/74869)).
#### XR
- Add `XRServer.world_origin` property ([GH-74151](https://github.com/godotengine/godot/pull/74151)).
- Enable access to the Valve Index grip force sensors ([GH-74787](https://github.com/godotengine/godot/pull/74787)).
### Changed
#### 2D
- Use 8×8 default grid size for TextureRegion and 2D polygon editors ([GH-73685](https://github.com/godotengine/godot/pull/73685)).
- Don't allow selecting nodes without owner in the editor ([GH-75492](https://github.com/godotengine/godot/pull/75492)).
#### Animation
- Update property keying state without a full Inspector rebuild ([GH-74564](https://github.com/godotengine/godot/pull/74564)).
#### Buildsystem
- Exit with non-zero status if there are issues with FreeType dependencies ([GH-74645](https://github.com/godotengine/godot/pull/74645)).
- SCons: Cleanup `pulseaudio` defines for Linux ([GH-74666](https://github.com/godotengine/godot/pull/74666)).
#### C#/.NET
- Encode `GodotProjectDir` as Base64 to prevent issues with special characters ([GH-74312](https://github.com/godotengine/godot/pull/74312)).
- Do not print errors about missing references to intentionally ignored members ([GH-75284](https://github.com/godotengine/godot/pull/75284)).
#### Core
- Make `Gradient` resort points on `reverse` ([GH-75235](https://github.com/godotengine/godot/pull/75235)).
- Port robust signal (dis)connection to `ShapeCast2D` ([GH-75266](https://github.com/godotengine/godot/pull/75266)).
#### Editor
- Improve POT Generation dialog ([GH-74213](https://github.com/godotengine/godot/pull/74213)).
- Hide internal settings from the class reference ([GH-74226](https://github.com/godotengine/godot/pull/74226)).
- Remove disabled plugins from active plugins ([GH-75331](https://github.com/godotengine/godot/pull/75331)).
- More i18n improvements ([GH-75385](https://github.com/godotengine/godot/pull/75385)).
#### Export
- Delete unused compression formats from `.import` files when exporting ([GH-74684](https://github.com/godotengine/godot/pull/74684)).
#### GDScript
- Make GDScript number highlighting stricter ([GH-74184](https://github.com/godotengine/godot/pull/74184)).
#### GUI
- Improve layout direction/locale automatic selection ([GH-73716](https://github.com/godotengine/godot/pull/73716)).
- Add mutex for FreeType face creation/deletion operations in TextServer ([GH-73987](https://github.com/godotengine/godot/pull/73987)).
#### Input
- Remove `meta_mem` update on keyup/keydown on Windows ([GH-75172](https://github.com/godotengine/godot/pull/75172)).
#### Physics
- Revert attempted fix of trimesh CCD ([GH-74861](https://github.com/godotengine/godot/pull/74861)).
#### Porting
- Android: Bump the target SDK version to 33 (Android 13) ([GH-75203](https://github.com/godotengine/godot/pull/75203)).
#### Project converter
- Remove Tween properties/signals from renames ([GH-75443](https://github.com/godotengine/godot/pull/75443)).
#### Rendering
- Incorporating the availability of screen and depth textures for the GLES3 backend ([GH-72361](https://github.com/godotengine/godot/pull/72361)).
#### Thirdparty
- mymindstorm/setup-emsdk updated to 12.
#### XR
- Replace OpenXR operating system alert dialog with a warning log message ([GH-73144](https://github.com/godotengine/godot/pull/73144)).
- Check hardware sRGB conversion when an sRGB target is used ([GH-74892](https://github.com/godotengine/godot/pull/74892)).
### Fixed
#### 2D
- Fix preview rendering and transform calculations in the tiles editor ([GH-74982](https://github.com/godotengine/godot/pull/74982)).
- Fix `ENTER_CANVAS` / `VISIBILITY_CHANGED` notification order when `CanvasItem` enters tree ([GH-75238](https://github.com/godotengine/godot/pull/75238)).
- Fix a crash in the tiles editor when merging atlases ([GH-75361](https://github.com/godotengine/godot/pull/75361)).
#### 3D
- Fix GridMap signal `cell_size_changed` disconnect error ([GH-74890](https://github.com/godotengine/godot/pull/74890)).
#### Animation
- Fix `AnimatedSprite2D` autoplay warning ([GH-75258](https://github.com/godotengine/godot/pull/75258)).
#### Buildsystem
- Fix xml namespace in org.godotengine.Godot.xml ([GH-74920](https://github.com/godotengine/godot/pull/74920)).
#### C#/.NET
- Fix building projects for MSBuild before 17.3 ([GH-74479](https://github.com/godotengine/godot/pull/74479)).
- Fix `Array.AddRange` index out of bounds ([GH-75357](https://github.com/godotengine/godot/pull/75357)).
#### Core
- Fix some race conditions that happen during initialization ([GH-73793](https://github.com/godotengine/godot/pull/73793)).
- Fix crash in resource load ([GH-74166](https://github.com/godotengine/godot/pull/74166)).
- Fix `randfn` to prevent it from generating nan values ([GH-74248](https://github.com/godotengine/godot/pull/74248)).
- Fix Variant hashing for floats ([GH-74600](https://github.com/godotengine/godot/pull/74600)).
- Fix type check for `max`/`min` ([GH-74770](https://github.com/godotengine/godot/pull/74770)).
- Fix `Array.slice()` rounding when step is other than 1 ([GH-74909](https://github.com/godotengine/godot/pull/74909)).
#### Editor
- Fix cancelling selection while gizmo editing making uncommitted changes ([GH-71156](https://github.com/godotengine/godot/pull/71156)).
- Fix `EditorUndoRedoManager`'s handling of `MERGE_ENDS` ([GH-74460](https://github.com/godotengine/godot/pull/74460)).
- Fix built-in scripts missing their methods on signal connection ([GH-74495](https://github.com/godotengine/godot/pull/74495)).
- Fix "Download Project Source" for the Web Editor ([GH-75194](https://github.com/godotengine/godot/pull/75194)).
- Fix incorrect sizes of some editor elements ([GH-75379](https://github.com/godotengine/godot/pull/75379), [GH-75381](https://github.com/godotengine/godot/pull/75381)).
#### Export
- Fix GDExtensions library export when multiple architectures are set ([GH-74057](https://github.com/godotengine/godot/pull/74057)).
#### GDScript
- Fix "Find in Files" search results not opening built-in script ([GH-74401](https://github.com/godotengine/godot/pull/74401)).
- Fix false positive `REDUNDANT_AWAIT` warning ([GH-74949](https://github.com/godotengine/godot/pull/74949)).
#### GUI
- Fix scrolling behavior with zero/low page value ([GH-67910](https://github.com/godotengine/godot/pull/67910)).
- Fix some ways to create inconsistent Viewport size states ([GH-73188](https://github.com/godotengine/godot/pull/73188)).
- Fix `GraphNode` resizing when its bottom border is too thin ([GH-73800](https://github.com/godotengine/godot/pull/73800)).
- Fix IME position in the single window mode sub-windows ([GH-74472](https://github.com/godotengine/godot/pull/74472)).
- Fix gutter set width results in receiving only half of the desired size ([GH-74537](https://github.com/godotengine/godot/pull/74537)).
- Fix `get_drag_data` not overridable in some Controls ([GH-75122](https://github.com/godotengine/godot/pull/75122)).
- Fix block caret size at the end of the line ([GH-75597](https://github.com/godotengine/godot/pull/75597)).
#### Import
- Fix `ResourceImporterLayeredTexture::import()` `high_quality` variable type ([GH-75244](https://github.com/godotengine/godot/pull/75244)).
#### Input
- Fix layout bug in `keyboard_get_keycode_from_physical` on Linux/X11 ([GH-75461](https://github.com/godotengine/godot/pull/75461)).
#### Navigation
- Fix GridMap free navigation RID error spam ([GH-74889](https://github.com/godotengine/godot/pull/74889)).
- Fix agents with disabled avoidance getting added to avoidance simulation ([GH-74893](https://github.com/godotengine/godot/pull/74893)).
#### Networking
- Fix list handling in `SceneReplicationConfig` ([GH-74552](https://github.com/godotengine/godot/pull/74552)).
#### Physics
- Fix `collide_shape` return type ([GH-75260](https://github.com/godotengine/godot/pull/75260)).
- Fix property hint for platform layers on 3D physics body ([GH-75544](https://github.com/godotengine/godot/pull/75544)).
#### Porting
- Android: Fix directory access when the running app has the `All files access` permission ([GH-75146](https://github.com/godotengine/godot/pull/75146)).
- macOS: Fix infinite loop caused by global menu callbacks which trigger EditorProgress dialog ([GH-75254](https://github.com/godotengine/godot/pull/75254)).
#### Rendering
- Fix spotlight shadows in volumetric fog ([GH-73919](https://github.com/godotengine/godot/pull/73919)).
- Fix issues with point size not functioning correctly in GLES3 ([GH-73966](https://github.com/godotengine/godot/pull/73966)).
- Update GPUParticles2D/3D speed scale on `ENTER_TREE` ([GH-75398](https://github.com/godotengine/godot/pull/75398)).
#### Shaders
- Fix ndc calculation for LinearSceneDepth VS node in GLES3 ([GH-74910](https://github.com/godotengine/godot/pull/74910)).
#### XR
- Fix typo in OpenXR pose orientation check ([GH-74928](https://github.com/godotengine/godot/pull/74928)).
## [4.0.1] - 2023-03-20
See the [release announcement](https://godotengine.org/article/maintenance-release-godot-4-0-1) for details.
### Added
#### Import
- Set the unlit / unshaded extension when importing / exporting glTF ([GH-74287](https://github.com/godotengine/godot/pull/74287)).
#### Project converter
- Add keycode project conversion ([GH-74237](https://github.com/godotengine/godot/pull/74237)).
- Add conversion for common Theme Overrides ([GH-74624](https://github.com/godotengine/godot/pull/74624)).
- Move tool declarations to top ([GH-74432](https://github.com/godotengine/godot/pull/74432)).
#### Tilemaps
- Remember previously selected TileMap tile ([GH-74039](https://github.com/godotengine/godot/pull/74039)).
### Changed
#### Animation
- Check for type mismatch in `PropertyTweener.from()` ([GH-74112](https://github.com/godotengine/godot/pull/74112)).
#### Buildsystem
- Safeguard Makefile commands for documentation ([GH-74042](https://github.com/godotengine/godot/pull/74042)).
#### C#/.NET
- Always show "Create C# solution" option ([GH-73904](https://github.com/godotengine/godot/pull/73904)).
#### Core
- Propagate errors when creating an OpenGL context fails in X11 ([GH-74563](https://github.com/godotengine/godot/pull/74563)).
#### Editor
- Automatically reparent editor message dialogs to avoid error spam ([GH-73365](https://github.com/godotengine/godot/pull/73365)).
- Translate strings which were previously missed ([GH-74211](https://github.com/godotengine/godot/pull/74211), [GH-74637](https://github.com/godotengine/godot/pull/74637)).
- Disallow creating a project in the Home or Documents folder ([GH-74964](https://github.com/godotengine/godot/pull/74964)).
#### GDScript
- Don't autocomplete numbers ([GH-74466](https://github.com/godotengine/godot/pull/74466)).
#### GUI
- Assume outline size is 1 if it's not set, but channel for outline is defined in a BitMap font ([GH-74212](https://github.com/godotengine/godot/pull/74212)).
- Do not draw virtual spaces (word break / justification points) ([GH-74488](https://github.com/godotengine/godot/pull/74488)).
- Generate empty textures for theme icons if the SVG module is disabled ([GH-74551](https://github.com/godotengine/godot/pull/74551)).
- Add invalid font scaling check, restrict Linux/BSD system fonts lookup to TrueType/CFF only ([GH-74702](https://github.com/godotengine/godot/pull/74702)).
#### Input
- Update modifier key status during IME input on Windows ([GH-74474](https://github.com/godotengine/godot/pull/74474)).
#### Navigation
- Allow negative NavigationAgent2D path debug line_width for thin lines ([GH-74800](https://github.com/godotengine/godot/pull/74800)).
#### Project converter
- Do not convert lines that start with a comment ([GH-74193](https://github.com/godotengine/godot/pull/74193)).
- Don't strip whitespace when converting ([GH-74232](https://github.com/godotengine/godot/pull/74232)).
#### Rendering
- Use MSAA 2D texture in multipass tonemapper ([GH-74150](https://github.com/godotengine/godot/pull/74150)).
- Use linear filtering without mipmaps for ProceduralSkyMaterial and PhysicalSkyMaterial ([GH-74740](https://github.com/godotengine/godot/pull/74740)).
### Fixed
#### Audio
- Improve logic related to editing audio buses and prevent crashes ([GH-74560](https://github.com/godotengine/godot/pull/74560)).
#### C#/.NET
- Fix crash when errors occur before language initialization ([GH-74127](https://github.com/godotengine/godot/pull/74127)).
- Get singleton instances using the Core name ([GH-74280](https://github.com/godotengine/godot/pull/74280)).
- Ensure that script names (and therefore class names) are valid identifiers ([GH-74330](https://github.com/godotengine/godot/pull/74330)).
- Ignore explicit interface implementations ([GH-74375](https://github.com/godotengine/godot/pull/74375)).
#### Core
- Set properties of ImageTexture3D when creating ([GH-74521](https://github.com/godotengine/godot/pull/74521)).
- Fix buffer overrun in CPUParticles3D in `precision=double` builds ([GH-74555](https://github.com/godotengine/godot/pull/74555)).
- Prevent crashing on startup if project has scripted theme types ([GH-74565](https://github.com/godotengine/godot/pull/74565)).
#### Editor
- Disable local space for Blender-style transforms ([GH-59443](https://github.com/godotengine/godot/pull/59443), [GH-74601](https://github.com/godotengine/godot/pull/74601)).
- Stop toaster notification circle flickering ([GH-74017](https://github.com/godotengine/godot/pull/74017)).
- Fix dock name lost translation after layout change ([GH-74158](https://github.com/godotengine/godot/pull/74158)).
- Fix crash when showing file in FileSystem dock ([GH-74591](https://github.com/godotengine/godot/pull/74591)).
- Prevent cache corruption when saving resources in the editor ([GH-74615](https://github.com/godotengine/godot/pull/74615)).
- Ensure that editor color map is initialized in the project manager ([GH-74750](https://github.com/godotengine/godot/pull/74750)).
- Fix MultiNodeEdit not cleared after deleting nodes ([GH-74795](https://github.com/godotengine/godot/pull/74795)).
- Fix error when opening Inspector's dots menu ([GH-74974](https://github.com/godotengine/godot/pull/74974)).
#### Export
- Fix various issues related to remote deploy and remote execute on Windows ([GH-74030](https://github.com/godotengine/godot/pull/74030)).
#### GDExtension
- Fix crash when dumping extension API in a non-writable directory ([GH-74590](https://github.com/godotengine/godot/pull/74590)).
- Fix extension bindings for motion collision/result structs ([GH-74671](https://github.com/godotengine/godot/pull/74671)).
#### GDScript
- Fix error spam when naming a func at the end of the script ([GH-73410](https://github.com/godotengine/godot/pull/73410)).
- Fix checking if a call is awaited in compiler ([GH-74147](https://github.com/godotengine/godot/pull/74147)).
- Fix autocomplete inside a block with a type test condition ([GH-74689](https://github.com/godotengine/godot/pull/74689)).
#### GUI
- Fix RichTextLabel crash with out of bound exception ([GH-68325](https://github.com/godotengine/godot/pull/68325)).
- Fix justification on punctuation characters ([GH-74477](https://github.com/godotengine/godot/pull/74477)).
- Add missing handler for removing font sizes in the theme editor ([GH-74547](https://github.com/godotengine/godot/pull/74547)).
#### Import
- Fix glTF mesh importer not freeing nodes correctly on import ([GH-74018](https://github.com/godotengine/godot/pull/74018)).
- Prevent infinite loop by disabling importer when canceling FBX2glTF setup ([GH-74293](https://github.com/godotengine/godot/pull/74293)).
- Fix blend-file import when using custom color management in blender ([GH-74496](https://github.com/godotengine/godot/pull/74496)).
#### Input
- Fix InputEventConfigurationDialog modifies original event ([GH-74858](https://github.com/godotengine/godot/pull/74858)).
#### Navigation
- Fix NavigationAgent3D debug path duplicated points ([GH-74976](https://github.com/godotengine/godot/pull/74976)).
#### Porting
- Android: Fix null-pointer dereference when using `gl_compatibility` renderer ([GH-74781](https://github.com/godotengine/godot/pull/74781)).
- Linux/X11: Check if required xkb functions exist before using it ([GH-74222](https://github.com/godotengine/godot/pull/74222)).
- Linux/X11: Fix broken shortcut key input ([GH-74535](https://github.com/godotengine/godot/pull/74535)).
#### Project converter
- Correct superclass constructors ([GH-74354](https://github.com/godotengine/godot/pull/74354)).
- Add parentheses around arguments when converting `xform` ([GH-74693](https://github.com/godotengine/godot/pull/74693)).
#### Rendering
- Add proper default texture filter and repeat modes for Canvas shaders in the OpenGL3 renderer ([GH-74315](https://github.com/godotengine/godot/pull/74315)).
- Fix instance uniforms breaking when setting a new mesh ([GH-74349](https://github.com/godotengine/godot/pull/74349)).
- Fix AABB calculation for meshes using Skeleton2D ([GH-74416](https://github.com/godotengine/godot/pull/74416)).
- Avoid overflow when calculating ptr address for 3D textures in RenderingDevice texture update ([GH-74526](https://github.com/godotengine/godot/pull/74526)).
- Fixes a canvas item set to clip children being drawn as black if no children are visible ([GH-74533](https://github.com/godotengine/godot/pull/74533)).
- Avoid copying CanvasTexture when updating proxy ([GH-74566](https://github.com/godotengine/godot/pull/74566)).
#### Tilemaps
- Fix TileSetEditor painting `texture_origin` Vector2i ([GH-73514](https://github.com/godotengine/godot/pull/73514)).
## [4.0] - 2023-03-01
The Godot 4.0 release was our biggest released to date, spanning 4 years of
@@ -791,7 +1168,7 @@ See the [release announcement](https://godotengine.org/article/godot-3-4-is-rele
#### Thirdparty
- Bullet uppdated to version 3.17.
- Bullet updated to version 3.17.
- Embree updated to version 3.13.0.
- MbedTLS updated to version 2.16.11 (security update).
- NanoSVG updated to 2021-09-03 git snapshot (security update).
@@ -932,7 +1309,7 @@ See the [release announcement](https://godotengine.org/article/godot-3-4-is-rele
- Fix and clean disabled shapes handling in Godot physics servers ([GH-49845](https://github.com/godotengine/godot/pull/49845)).
- Fix `KinematicBody` axis lock ([GH-45176](https://github.com/godotengine/godot/pull/45176)).
- Don't override `KinematicCollision` reference when still in use in script ([GH-52955](https://github.com/godotengine/godot/pull/52955)).
- Fix ragdoll simulation when parent was readded to scene ([GH-48823](https://github.com/godotengine/godot/pull/48823)).
- Fix ragdoll simulation when parent was re-added to scene ([GH-48823](https://github.com/godotengine/godot/pull/48823)).
- Ignore disabled shapes for mass property calculations ([GH-49699](https://github.com/godotengine/godot/pull/49699)).
#### Porting
@@ -2440,6 +2817,8 @@ See the [release announcement](https://godotengine.org/article/godot-3-3-has-arr
- Only WebAssembly is supported now, since all browsers supporting WebGL 2.0 also support WebAssembly.
[4.0.2]: https://github.com/godotengine/godot/compare/4.0.1-stable...4.0.2-stable
[4.0.1]: https://github.com/godotengine/godot/compare/4.0-stable...4.0.1-stable
[4.0]: https://github.com/godotengine/godot/compare/3.2-stable...4.0-stable
[3.5]: https://github.com/godotengine/godot/compare/3.4-stable...3.5-stable
[3.4]: https://github.com/godotengine/godot/compare/3.3-stable...3.4-stable

View File

@@ -645,7 +645,7 @@ if selected_platform in platform_list:
print(
"Detected mingw version is not using posix threads. Only posix "
"version of mingw is supported. "
'Use "update-alternatives --config <platform>-w64-mingw32-[gcc|g++]" '
'Use "update-alternatives --config x86_64-w64-mingw32-g++" '
"to switch to posix threads."
)
Exit(255)

View File

@@ -401,6 +401,10 @@ void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {
vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE;
}
if (v->internal) {
vc.flags |= PROPERTY_USAGE_INTERNAL;
}
if (v->basic) {
vc.flags |= PROPERTY_USAGE_EDITOR_BASIC_SETTING;
}
@@ -1242,7 +1246,7 @@ void ProjectSettings::_add_builtin_input_map() {
action["events"] = events;
String action_name = "input/" + E.key;
GLOBAL_DEF_INTERNAL(action_name, action);
GLOBAL_DEF(action_name, action);
input_presets.push_back(action_name);
}
}
@@ -1266,6 +1270,10 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("application/config/custom_user_dir_name", "");
GLOBAL_DEF("application/config/project_settings_override", "");
GLOBAL_DEF("application/run/main_loop_type", "SceneTree");
GLOBAL_DEF("application/config/auto_accept_quit", true);
GLOBAL_DEF("application/config/quit_on_go_back", true);
// The default window size is tuned to:
// - Have a 16:9 aspect ratio,
// - Have both dimensions divisible by 8 to better play along with video recording,
@@ -1304,26 +1312,23 @@ ProjectSettings::ProjectSettings() {
}
extensions.push_back("gdshader");
GLOBAL_DEF("editor/run/main_run_args", "");
GLOBAL_DEF(PropertyInfo(Variant::PACKED_STRING_ARRAY, "editor/script/search_in_file_extensions"), extensions);
GLOBAL_DEF(PropertyInfo(Variant::STRING, "editor/script/templates_search_path", PROPERTY_HINT_DIR), "res://script_templates");
// For correct doc generation.
GLOBAL_DEF("editor/naming/default_signal_callback_name", "_on_{node_name}_{signal_name}");
GLOBAL_DEF("editor/naming/default_signal_callback_to_self_name", "_on_{signal_name}");
_add_builtin_input_map();
// Keep the enum values in sync with the `DisplayServer::ScreenOrientation` enum.
custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::INT, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait,Reverse Landscape,Reverse Portrait,Sensor Landscape,Sensor Portrait,Sensor");
GLOBAL_DEF("display/window/subwindows/embed_subwindows", true);
// Keep the enum values in sync with the `DisplayServer::VSyncMode` enum.
custom_prop_info["display/window/vsync/vsync_mode"] = PropertyInfo(Variant::INT, "display/window/vsync/vsync_mode", PROPERTY_HINT_ENUM, "Disabled,Enabled,Adaptive,Mailbox");
custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
GLOBAL_DEF("physics/2d/run_on_separate_thread", false);
GLOBAL_DEF("physics/3d/run_on_separate_thread", false);
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,canvas_items,viewport"), "disabled");
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"), "keep");
GLOBAL_DEF_BASIC(PropertyInfo(Variant::FLOAT, "display/window/stretch/scale", PROPERTY_HINT_RANGE, "0.5,8.0,0.01"), 1.0);
GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1"), 16384);
GLOBAL_DEF(PropertyInfo(Variant::BOOL, "compression/formats/zstd/long_distance_matching"), Compression::zstd_long_distance_matching);
@@ -1339,18 +1344,26 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/occlusion_culling/bvh_build_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"), 2);
GLOBAL_DEF(PropertyInfo(Variant::INT, "memory/limits/multithreaded_server/rid_pool_prealloc", PROPERTY_HINT_RANGE, "0,500,1"), 60); // No negative and limit to 500 due to crashes.
GLOBAL_DEF_RST("internationalization/rendering/force_right_to_left_layout_direction", false);
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "internationalization/rendering/root_node_layout_direction", PROPERTY_HINT_RANGE, "Based on Locale,Left-to-Right,Right-to-Left"), 0);
GLOBAL_DEF(PropertyInfo(Variant::INT, "gui/timers/incremental_search_max_interval_msec", PROPERTY_HINT_RANGE, "0,10000,1,or_greater"), 2000);
GLOBAL_DEF_BASIC("gui/common/snap_controls_to_pixels", true);
GLOBAL_DEF_BASIC("gui/fonts/dynamic_fonts/use_oversampling", true);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/block_size_kb", 256);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/max_size_mb", 128);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64);
GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64);
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Linear Mipmap,Nearest Mipmap"), 1);
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM, "Disable,Enable,Mirror"), 0);
// These properties will not show up in the dialog nor in the documentation. If you want to exclude whole groups, see _get_property_list() method.
GLOBAL_DEF_INTERNAL("application/config/features", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translation_remaps", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translations", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translations_pot_files", PackedStringArray());
}
ProjectSettings::~ProjectSettings() {

View File

@@ -1052,6 +1052,7 @@ void GDExtensionAPIDump::generate_extension_json_file(const String &p_path) {
String text = json->stringify(api, "\t", false) + "\n";
Ref<FileAccess> fa = FileAccess::open(p_path, FileAccess::WRITE);
ERR_FAIL_COND_MSG(fa.is_null(), vformat("Cannot open file '%s' for writing.", p_path));
fa->store_string(text);
}

View File

@@ -27,6 +27,7 @@ class GDExtensionInterfaceDump {
public:
static void generate_gdextension_interface_file(const String &p_path) {
Ref<FileAccess> fa = FileAccess::open(p_path, FileAccess::WRITE);
ERR_FAIL_COND_MSG(fa.is_null(), vformat("Cannot open file '%s' for writing.", p_path));
CharString cs(gdextension_interface_dump);
fa->store_buffer((const uint8_t *)cs.ptr(), cs.length());
};

View File

@@ -75,7 +75,7 @@ struct _IP_ResolverPrivate {
Semaphore sem;
Thread thread;
bool thread_abort = false;
SafeFlag thread_abort;
void resolve_queues() {
for (int i = 0; i < IP::RESOLVER_MAX_QUERIES; i++) {
@@ -111,7 +111,7 @@ struct _IP_ResolverPrivate {
static void _thread_function(void *self) {
_IP_ResolverPrivate *ipr = static_cast<_IP_ResolverPrivate *>(self);
while (!ipr->thread_abort) {
while (!ipr->thread_abort.is_set()) {
ipr->sem.wait();
ipr->resolve_queues();
}
@@ -343,12 +343,12 @@ IP::IP() {
singleton = this;
resolver = memnew(_IP_ResolverPrivate);
resolver->thread_abort = false;
resolver->thread_abort.clear();
resolver->thread.start(_IP_ResolverPrivate::_thread_function, resolver);
}
IP::~IP() {
resolver->thread_abort = true;
resolver->thread_abort.set();
resolver->sem.post();
resolver->thread.wait_to_finish();

View File

@@ -91,9 +91,12 @@ String JSON::_stringify(const Variant &p_var, const String &p_indent, int p_cur_
case Variant::PACKED_FLOAT64_ARRAY:
case Variant::PACKED_STRING_ARRAY:
case Variant::ARRAY: {
Array a = p_var;
if (a.size() == 0) {
return "[]";
}
String s = "[";
s += end_statement;
Array a = p_var;
ERR_FAIL_COND_V_MSG(p_markers.has(a.id()), "\"[...]\"", "Converting circular structure to JSON.");
p_markers.insert(a.id());

View File

@@ -492,13 +492,21 @@ Ref<Resource> ResourceLoader::load_threaded_get(const String &p_path, Error *r_e
print_lt("GET: load count: " + itos(thread_loading_count) + " / wait count: " + itos(thread_waiting_count) + " / suspended count: " + itos(thread_suspended_count) + " / active: " + itos(thread_loading_count - thread_suspended_count));
}
bool still_valid = true;
bool was_thread = load_task.thread;
do {
load_task.cond_var->wait(thread_load_lock);
if (!thread_load_tasks.has(local_path)) { //may have been erased during unlock and this was always an invalid call
still_valid = false;
break;
}
} while (load_task.cond_var); // In case of spurious wakeup.
thread_suspended_count--;
if (was_thread) {
thread_suspended_count--;
}
if (!thread_load_tasks.has(local_path)) { //may have been erased during unlock and this was always an invalid call
if (!still_valid) {
if (r_error) {
*r_error = ERR_INVALID_PARAMETER;
}

View File

@@ -126,10 +126,18 @@ public:
}
_FORCE_INLINE_ double randfn(double p_mean, double p_deviation) {
return p_mean + p_deviation * (cos(Math_TAU * randd()) * sqrt(-2.0 * log(randd()))); // Box-Muller transform
double temp = randd();
if (temp < CMP_EPSILON) {
temp += CMP_EPSILON; // To prevent generating of INF value in log function, resulting to return NaN value from this function.
}
return p_mean + p_deviation * (cos(Math_TAU * randd()) * sqrt(-2.0 * log(temp))); // Box-Muller transform.
}
_FORCE_INLINE_ float randfn(float p_mean, float p_deviation) {
return p_mean + p_deviation * (cos((float)Math_TAU * randf()) * sqrt(-2.0 * log(randf()))); // Box-Muller transform
float temp = randf();
if (temp < CMP_EPSILON) {
temp += CMP_EPSILON; // To prevent generating of INF value in log function, resulting to return NaN value from this function.
}
return p_mean + p_deviation * (cos((float)Math_TAU * randf()) * sqrt(-2.0 * log(temp))); // Box-Muller transform.
}
double random(double p_from, double p_to);

View File

@@ -50,8 +50,8 @@ void Thread::_set_platform_functions(const PlatformFunctions &p_functions) {
platform_functions = p_functions;
}
void Thread::callback(Thread *p_self, const Settings &p_settings, Callback p_callback, void *p_userdata) {
Thread::caller_id = _thread_id_hash(p_self->thread.get_id());
void Thread::callback(ID p_caller_id, const Settings &p_settings, Callback p_callback, void *p_userdata) {
Thread::caller_id = p_caller_id;
if (platform_functions.set_priority) {
platform_functions.set_priority(p_settings.priority);
}
@@ -79,7 +79,7 @@ void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_
std::thread empty_thread;
thread.swap(empty_thread);
}
std::thread new_thread(&Thread::callback, this, p_settings, p_callback, p_user);
std::thread new_thread(&Thread::callback, _thread_id_hash(thread.get_id()), p_settings, p_callback, p_user);
thread.swap(new_thread);
id = _thread_id_hash(thread.get_id());
}

View File

@@ -82,7 +82,7 @@ private:
static thread_local ID caller_id;
std::thread thread;
static void callback(Thread *p_self, const Settings &p_settings, Thread::Callback p_callback, void *p_userdata);
static void callback(ID p_caller_id, const Settings &p_settings, Thread::Callback p_callback, void *p_userdata);
static PlatformFunctions platform_functions;

View File

@@ -712,7 +712,25 @@ String TranslationServer::get_tool_locale() {
#else
{
#endif
return get_locale();
// Look for best matching loaded translation.
String best_locale = "en";
int best_score = 0;
for (const Ref<Translation> &E : translations) {
const Ref<Translation> &t = E;
ERR_FAIL_COND_V(t.is_null(), best_locale);
String l = t->get_locale();
int score = compare_locales(locale, l);
if (score > 0 && score >= best_score) {
best_locale = l;
best_score = score;
if (score == 10) {
break; // Exact match, skip the rest.
}
}
}
return best_locale;
}
}

View File

@@ -305,9 +305,9 @@ struct BuildIndexSequence<0, Is...> : IndexSequence<Is...> {};
#endif
// Macro GD_IS_DEFINED() allows to check if a macro is defined. It needs to be defined to anything (say 1) to work.
#define __GDARG_PLACEHOLDER_1 0,
#define __GDARG_PLACEHOLDER_1 false,
#define __gd_take_second_arg(__ignored, val, ...) val
#define ____gd_is_defined(arg1_or_junk) __gd_take_second_arg(arg1_or_junk 1, 0)
#define ____gd_is_defined(arg1_or_junk) __gd_take_second_arg(arg1_or_junk true, false)
#define ___gd_is_defined(val) ____gd_is_defined(__GDARG_PLACEHOLDER_##val)
#define GD_IS_DEFINED(x) ___gd_is_defined(x)

View File

@@ -466,7 +466,7 @@ Array Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const {
ERR_FAIL_COND_V_MSG(p_step > 0 && begin > end, result, "Slice is positive, but bounds is decreasing.");
ERR_FAIL_COND_V_MSG(p_step < 0 && begin < end, result, "Slice is negative, but bounds is increasing.");
int result_size = (end - begin) / p_step;
int result_size = (end - begin) / p_step + (((end - begin) % p_step != 0) ? 1 : 0);
result.resize(result_size);
for (int src_idx = begin, dest_idx = 0; dest_idx < result_size; ++dest_idx) {

View File

@@ -2941,7 +2941,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const {
return hash_one_uint64((uint64_t)_data._int);
} break;
case FLOAT: {
return hash_murmur3_one_float(_data._float);
return hash_murmur3_one_double(_data._float);
} break;
case STRING: {
return reinterpret_cast<const String *>(_data._mem)->hash();
@@ -3158,7 +3158,7 @@ uint32_t Variant::recursive_hash(int recursion_count) const {
}
return hash_fmix32(h);
} else {
return hash_murmur3_one_float(0.0);
return hash_murmur3_one_double(0.0);
}
} break;

View File

@@ -542,7 +542,8 @@ struct VariantUtilityFunctions {
}
Variant base = *p_args[0];
Variant ret;
for (int i = 1; i < p_argcount; i++) {
for (int i = 0; i < p_argcount; i++) {
Variant::Type arg_type = p_args[i]->get_type();
if (arg_type != Variant::INT && arg_type != Variant::FLOAT) {
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
@@ -550,6 +551,9 @@ struct VariantUtilityFunctions {
r_error.argument = i;
return Variant();
}
if (i == 0) {
continue;
}
bool valid;
Variant::evaluate(Variant::OP_LESS, base, *p_args[i], ret, valid);
if (!valid) {
@@ -582,7 +586,8 @@ struct VariantUtilityFunctions {
}
Variant base = *p_args[0];
Variant ret;
for (int i = 1; i < p_argcount; i++) {
for (int i = 0; i < p_argcount; i++) {
Variant::Type arg_type = p_args[i]->get_type();
if (arg_type != Variant::INT && arg_type != Variant::FLOAT) {
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
@@ -590,6 +595,9 @@ struct VariantUtilityFunctions {
r_error.argument = i;
return Variant();
}
if (i == 0) {
continue;
}
bool valid;
Variant::evaluate(Variant::OP_GREATER, base, *p_args[i], ret, valid);
if (!valid) {

View File

@@ -1,28 +1,28 @@
BASEDIR = .
CLASSES = $(BASEDIR)/classes/ $(BASEDIR)/../modules/
CLASSES = "$(BASEDIR)/classes/" "$(BASEDIR)/../modules/"
OUTPUTDIR = $(BASEDIR)/_build
TOOLSDIR = $(BASEDIR)/tools
JSDIR = $(BASEDIR)/../platform/web
JSDIR = "$(BASEDIR)/../platform/web"
LANGARG ?= en
LANGCMD = -l $(LANGARG)
.ONESHELL:
clean:
rm -rf $(OUTPUTDIR)
rm -rf "$(OUTPUTDIR)"
doxygen:
rm -rf $(OUTPUTDIR)/doxygen
mkdir -p $(OUTPUTDIR)/doxygen
rm -rf "$(OUTPUTDIR)/doxygen"
mkdir -p "$(OUTPUTDIR)/doxygen"
doxygen Doxyfile
rst:
rm -rf $(OUTPUTDIR)/rst
mkdir -p $(OUTPUTDIR)/rst
python3 $(TOOLSDIR)/make_rst.py -o $(OUTPUTDIR)/rst $(LANGCMD) $(CLASSES)
rm -rf "$(OUTPUTDIR)/rst"
mkdir -p "$(OUTPUTDIR)/rst"
python3 "$(TOOLSDIR)/make_rst.py" -o "$(OUTPUTDIR)/rst" "$(LANGCMD)" $(CLASSES)
rstjs:
rm -rf $(OUTPUTDIR)/rstjs
mkdir -p $(OUTPUTDIR)/rstjs
npm --prefix $(JSDIR) ci
npm --prefix $(JSDIR) run docs -- --destination $(OUTPUTDIR)/rstjs/html5_shell_classref.rst
rm -rf "$(OUTPUTDIR)/rstjs"
mkdir -p "$(OUTPUTDIR)/rstjs"
npm --prefix "$(JSDIR)" ci
npm --prefix "$(JSDIR)" run docs -- --destination "$(OUTPUTDIR)/rstjs/html5_shell_classref.rst"

View File

@@ -622,7 +622,7 @@
<description>
Linearly interpolates between two values by the factor defined in [param weight]. To perform interpolation, [param weight] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i]. If this is not desired, use [method clampf] on the result of this function.
[codeblock]
lerp(0, 4, 0.75) # Returns 3.0
lerpf(0, 4, 0.75) # Returns 3.0
[/codeblock]
See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep].
</description>
@@ -645,8 +645,8 @@
<return type="float" />
<param index="0" name="x" type="float" />
<description>
Returns the natural logarithm of [param x]. This is the amount of time needed to reach a certain level of continuous growth.
[b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.
Returns the [url=https://en.wikipedia.org/wiki/Natural_logarithm]natural logarithm[/url] of [param x] (base [url=https://en.wikipedia.org/wiki/E_(mathematical_constant)][i]e[/i][/url], with [i]e[/i] being approximately 2.71828). This is the amount of time needed to reach a certain level of continuous growth.
[b]Note:[/b] This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. To use base 10 logarithm, use [code]log(x) / log(10)[/code].
[codeblock]
log(10) # Returns 2.302585
[/codeblock]
@@ -1142,9 +1142,9 @@
<description>
Returns [code]-1.0[/code] if [param x] is negative, [code]1.0[/code] if [param x] is positive, and [code]0.0[/code] if [param x] is zero.
[codeblock]
sign(-6.5) # Returns -1.0
sign(0.0) # Returns 0.0
sign(6.5) # Returns 1.0
signf(-6.5) # Returns -1.0
signf(0.0) # Returns 0.0
signf(6.5) # Returns 1.0
[/codeblock]
</description>
</method>
@@ -1154,9 +1154,9 @@
<description>
Returns [code]-1[/code] if [param x] is negative, [code]1[/code] if [param x] is positive, and [code]0[/code] if if [param x] is zero.
[codeblock]
sign(-6) # Returns -1
sign(0) # Returns 0
sign(6) # Returns 1
signi(-6) # Returns -1
signi(0) # Returns 0
signi(6) # Returns 1
[/codeblock]
</description>
</method>
@@ -1226,8 +1226,8 @@
Returns the multiple of [param step] that is the closest to [param x]. This can also be used to round a floating point number to an arbitrary number of decimals.
A type-safe version of [method snapped], returning a [float].
[codeblock]
snapped(32.0, 2.5) # Returns 32.5
snapped(3.14159, 0.01) # Returns 3.14
snappedf(32.0, 2.5) # Returns 32.5
snappedf(3.14159, 0.01) # Returns 3.14
[/codeblock]
</description>
</method>
@@ -1239,8 +1239,8 @@
Returns the multiple of [param step] that is the closest to [param x].
A type-safe version of [method snapped], returning an [int].
[codeblock]
snapped(53, 16) # Returns 48
snapped(4096, 100) # Returns 4100
snappedi(53, 16) # Returns 48
snappedi(4096, 100) # Returns 4100
[/codeblock]
</description>
</method>
@@ -2773,6 +2773,7 @@
The property is shown in the [EditorInspector] (default).
</constant>
<constant name="PROPERTY_USAGE_INTERNAL" value="8" enum="PropertyUsageFlags" is_bitfield="true">
The property is excluded from the class reference.
</constant>
<constant name="PROPERTY_USAGE_CHECKABLE" value="16" enum="PropertyUsageFlags" is_bitfield="true">
The property can be checked in the [EditorInspector].

View File

@@ -188,7 +188,7 @@
<param index="0" name="from" type="Vector3" />
<param index="1" name="dir" type="Vector3" />
<description>
Returns [code]true[/code] if the given ray intersects with this [AABB]. Ray length is infinite.
Returns the point of intersection of the given ray with this [AABB] or [code]null[/code] if there is no intersection. Ray length is infinite.
</description>
</method>
<method name="intersects_segment" qualifiers="const">
@@ -196,7 +196,7 @@
<param index="0" name="from" type="Vector3" />
<param index="1" name="to" type="Vector3" />
<description>
Returns [code]true[/code] if the [AABB] intersects the line segment between [param from] and [param to].
Returns the point of intersection between [param from] and [param to] with this [AABB] or [code]null[/code] if there is no intersection.
</description>
</method>
<method name="is_equal_approx" qualifiers="const">
@@ -237,7 +237,7 @@
<return type="bool" />
<param index="0" name="right" type="AABB" />
<description>
Returns [code]true[/code] if the vectors are not equal.
Returns [code]true[/code] if the AABBs are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
</description>
</operator>

View File

@@ -41,7 +41,6 @@
[b]Note:[/b] Concatenating with the [code]+=[/code] operator will create a new array, which has a cost. If you want to append another array to an existing array, [method append_array] is more efficient.
[b]Note:[/b] Arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [method duplicate].
[b]Note:[/b] Erasing elements while iterating over arrays is [b]not[/b] supported and will result in unpredictable behavior.
[b]Note:[/b] When declaring an array with [code]const[/code], the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using [code]const[/code] will only prevent assigning the constant with another value after it was initialized.
</description>
<tutorials>
</tutorials>

View File

@@ -390,7 +390,7 @@
Repeat flags for the texture. See [enum TextureFilter] for options.
</member>
<member name="transparency" type="int" setter="set_transparency" getter="get_transparency" enum="BaseMaterial3D.Transparency" default="0">
If [code]true[/code], transparency is enabled on the body. Some transparency modes will disable shadow casting. Any transparency mode other than Disabled has a greater performance impact compared to opaque rendering. See also [member blend_mode].
The material's transparency mode. Some transparency modes will disable shadow casting. Any transparency mode other than [constant TRANSPARENCY_DISABLED] has a greater performance impact compared to opaque rendering. See also [member blend_mode].
</member>
<member name="use_particle_trails" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering.

View File

@@ -294,7 +294,7 @@
Particle system's running speed scaling ratio. A value of [code]0[/code] can be used to pause the particles.
</member>
<member name="split_scale" type="bool" setter="set_split_scale" getter="get_split_scale" default="false">
If set to true, three different scale curves can be specified, one per scale axis.
If set to [code]true[/code], three different scale curves can be specified, one per scale axis.
</member>
<member name="spread" type="float" setter="set_spread" getter="get_spread" default="45.0">
Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes.

View File

@@ -569,13 +569,14 @@
The rendering layers in which this [CanvasItem] responds to [Light2D] nodes.
</member>
<member name="material" type="Material" setter="set_material" getter="get_material">
The material applied to textures on this [CanvasItem].
The material applied to this [CanvasItem].
</member>
<member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)">
The color applied to textures on this [CanvasItem].
The color applied to this [CanvasItem]. This property does affect child [CanvasItem]s, unlike [member self_modulate] which only affects the node itself.
</member>
<member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" default="Color(1, 1, 1, 1)">
The color applied to textures on this [CanvasItem]. This is not inherited by children [CanvasItem]s.
The color applied to this [CanvasItem]. This property does [b]not[/b] affect child [CanvasItem]s, unlike [member modulate] which affects both the node itself and its children.
[b]Note:[/b] Internal children (e.g. sliders in [ColorPicker] or tab bar in [TabContainer]) are also not affected by this property (see [code]include_internal[/code] parameter of [method Node.get_child] and other similar methods).
</member>
<member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false">
If [code]true[/code], the object draws behind its parent.

View File

@@ -15,6 +15,12 @@
<link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link>
</tutorials>
<methods>
<method name="apply_floor_snap">
<return type="void" />
<description>
Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns [code]true[/code].
</description>
</method>
<method name="get_floor_angle" qualifiers="const">
<return type="float" />
<param index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" />
@@ -67,8 +73,8 @@
[codeblocks]
[gdscript]
for i in get_slide_collision_count():
var collision = get_slide_collision(i)
print("Collided with: ", collision.collider.name)
var collision = get_slide_collision(i)
print("Collided with: ", collision.get_collider().name)
[/gdscript]
[csharp]
for (int i = 0; i &lt; GetSlideCollisionCount(); i++)
@@ -152,7 +158,7 @@
</member>
<member name="floor_snap_length" type="float" setter="set_floor_snap_length" getter="get_floor_snap_length" default="1.0">
Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction].
As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], so it will be able to detach from the ground when jumping.
As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap].
</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 calling [method move_and_slide] when the body is standing still.

View File

@@ -17,6 +17,12 @@
<link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
</tutorials>
<methods>
<method name="apply_floor_snap">
<return type="void" />
<description>
Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns [code]true[/code].
</description>
</method>
<method name="get_floor_angle" qualifiers="const">
<return type="float" />
<param index="0" name="up_direction" type="Vector3" default="Vector3(0, 1, 0)" />
@@ -144,7 +150,7 @@
</member>
<member name="floor_snap_length" type="float" setter="set_floor_snap_length" getter="get_floor_snap_length" default="0.1">
Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction].
As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], so it will be able to detach from the ground when jumping.
As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap].
</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 calling [method move_and_slide] when the body is standing still.

View File

@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionPolygon2D" inherits="Node2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Defines a 2D collision polygon.
Node that represents a 2D collision polygon.
</brief_description>
<description>
Provides a concave or convex 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices. See also [ConvexPolygonShape2D].
Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices.
Depending on the build mode, this node effectively provides several convex shapes (by convex decomposition of the polygon) or a single concave shape made of the polygon's segments.
In the editor, a [CollisionPolygon2D] can be generated from a [Sprite2D]'s outline by selecting a [Sprite2D] node, going to the [b]Sprite2D[/b] menu at the top of the 2D editor viewport then choosing [b]Create CollisionPolygon2D Sibling[/b].
</description>
<tutorials>
@@ -24,15 +25,16 @@
The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity.
</member>
<member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()">
The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the [PackedVector2Array], not a reference.
The polygon's list of vertices. Each point will be connected to the next, and the final point will be connected to the first.
[b]Warning:[/b] The returned value is a clone of the [PackedVector2Array], not a reference.
</member>
</members>
<constants>
<constant name="BUILD_SOLIDS" value="0" enum="BuildMode">
Collisions will include the polygon and its contained area.
Collisions will include the polygon and its contained area. In this mode the node has the same effect as several [ConvexPolygonShape2D] nodes, one for each convex shape in the convex decomposition of the polygon (but without the overhead of multiple nodes).
</constant>
<constant name="BUILD_SEGMENTS" value="1" enum="BuildMode">
Collisions will only include the polygon edges.
Collisions will only include the polygon edges. In this mode the node has the same effect as a single [ConcavePolygonShape2D] made of segments, with the restriction that each segment (after the first one) starts where the previous one ends, and the last one ends where the first one starts (forming a closed but hollow polygon).
</constant>
</constants>
</class>

View File

@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionPolygon3D" inherits="Node3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Editor-only node for defining a collision polygon in 3D space.
Node that represents a 3D collision polygon, given by the thickening of a 2D polygon in the local XY plane along the local Z axis.
</brief_description>
<description>
Allows editing a concave or convex collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates several [ConvexPolygonShape3D]s at run-time to represent the original polygon using convex decomposition.
[b]Note:[/b] Since this is an editor-only helper, properties modified during gameplay will have no effect.
Provides a 3D collision polygon to a [CollisionObject3D] parent, by thickening a 2D (convex or concave) polygon in the local XY plane along the local Z axis. The 2D polygon in the local XY plane can be drawn in the editor or specified by a list of vertices. That 2D polygon is thickened evenly in the local Z and -Z directions.
This node has the same effect as several [ConvexPolygonShape3D] nodes, created by thickening the 2D convex polygons in the convex decomposition of the given 2D polygon (but without the overhead of multiple nodes).
[b]Warning:[/b] A non-uniformly scaled CollisionPolygon3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change its [member polygon]'s vertices instead.
</description>
<tutorials>
</tutorials>
<members>
<member name="depth" type="float" setter="set_depth" getter="get_depth" default="1.0">
Length that the resulting collision extends in either direction perpendicular to its polygon.
Length that the resulting collision extends in either direction perpendicular to its 2D polygon.
</member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
If [code]true[/code], no collision will be produced.
@@ -21,7 +21,7 @@
The collision margin for the generated [Shape3D]. See [member Shape3D.margin] for more details.
</member>
<member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()">
Array of vertices which define the polygon.
Array of vertices which define the 2D polygon in the local XY plane.
[b]Note:[/b] The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the [code]polygon[/code] member.
</member>
</members>

View File

@@ -4,7 +4,7 @@
Node that represents collision shape data in 2D space.
</brief_description>
<description>
Editor facility for creating and editing collision shapes in 2D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape.
Editor facility for creating and editing collision shapes in 2D space. Set the [member shape] property to configure the shape.
You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object.
</description>
<tutorials>

View File

@@ -4,7 +4,7 @@
Node that represents collision shape data in 3D space.
</brief_description>
<description>
Editor facility for creating and editing collision shapes in 3D space. Set the [member shape] property to configure the shape. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject3D.shape_owner_get_shape] to get the actual shape.
Editor facility for creating and editing collision shapes in 3D space. Set the [member shape] property to configure the shape.
You can use this node to represent all sorts of collision shapes, for example, add this to an [Area3D] to give it a detection shape, or add it to a [PhysicsBody3D] to create a solid object.
[b]Warning:[/b] A non-uniformly scaled CollisionShape3D node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size of its [member shape] resource instead.
</description>

View File

@@ -4,16 +4,19 @@
Concave polygon shape resource for 2D physics.
</brief_description>
<description>
2D concave polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex to speed up collision detection.
[b]Performance:[/b] Due to its complexity, [ConcavePolygonShape2D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape2D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape2D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape2D]'s documentation for instructions. However, consider using primitive collision shapes such as [CircleShape2D] or [RectangleShape2D] first.
2D concave polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node.
The shape consists of a collection of line segments, and as such it does not include any "inside" that the segments might be enclosing. If the segments do enclose anything, then the shape is [i]hollow[/i], as opposed to a [ConvexPolygonShape2D] which is solid. See also [CollisionPolygon2D].
Being made out of line segments, this shape is the most freely configurable single 2D shape. It can be used to form (hollow) polygons of any nature, convex or concave.
[b]Note:[/b] When used for collision, [b]ConcavePolygonShape2D[/b] is intended to work with static [PhysicsBody2D] nodes like [StaticBody2D] and is not recommended to use with [RigidBody2D] nodes in a mode other than Static. A [CollisionPolygon2D] in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better suited for static bodies.
[b]Warning:[/b] The nature of this shape makes it extra prone to being tunneled through by (small) fast physics bodies. For example, consider a (small) rigid body [i]Ball[/i] traveling toward a static body [i]Box[/i] at high speed. If the box uses a [b]ConcavePolygonShape2D[/b] consisting of four segments, then the ball might end up inside the box or tunnel all the way through the box, if it goes fast enough. This is (partly) because the ball can only collide against the individual segments of the hollow box. In interactions with rigid bodies tunneling can be avoided by enabling continuous collision detection on the rigid body.
[b]Warning:[/b] Using this shape for an [Area2D] (via a [CollisionShape2D] node) may give unexpected results: the area will only detect collisions with the segments in the [ConcavePolygonShape2D] (and not with any "inside" of the shape, for example).
[b]Performance:[/b] Due to its complexity, [ConcavePolygonShape2D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape2D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape2D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape2D]'s documentation for instructions. However, consider using primitive collision shapes such as [CircleShape2D] or [RectangleShape2D] first.
</description>
<tutorials>
</tutorials>
<members>
<member name="segments" type="PackedVector2Array" setter="set_segments" getter="get_segments" default="PackedVector2Array()">
The array of points that make up the [ConcavePolygonShape2D]'s line segments.
The array of points that make up the [ConcavePolygonShape2D]'s line segments. The array (of length divisible by two) is naturally divided into pairs (one pair for each segment); each pair consists of the starting point of a segment and the endpoint of a segment.
</member>
</members>
</class>

View File

@@ -4,10 +4,13 @@
Concave polygon shape resource (also called "trimesh") for 3D physics.
</brief_description>
<description>
3D concave polygon shape resource (also called "trimesh") to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. This shape is created by feeding a list of triangles. Despite its name, [ConcavePolygonShape3D] can also store convex polygon shapes. However, unlike [ConvexPolygonShape3D], [ConcavePolygonShape3D] is [i]not[/i] limited to storing convex shapes exclusively.
[b]Note:[/b] When used for collision, [ConcavePolygonShape3D] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidBody3D] with a mode other than Static.
[b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape3D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. However, consider using primitive collision shapes such as [SphereShape3D] or [BoxShape3D] first.
3D concave polygon shape resource (also called "trimesh") to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node.
The shape consists of a collection of triangle faces, and as such it does not include any "inside" that the faces might be enclosing. If the faces enclose anything, then the shape is [i]hollow[/i], as opposed to a [ConvexPolygonShape3D] which is solid. See also [CollisionPolygon3D].
Being made out of triangle faces, this shape is the most freely configurable single 3D shape. Despite its name, it can be used to form (hollow) polyhedra of any nature, convex or concave.
[b]Note:[/b] When used for collision, [b]ConcavePolygonShape3D[/b] is intended to work with static [PhysicsBody3D] nodes like [StaticBody3D] and will not work with [CharacterBody3D] or [RigidBody3D] in a mode other than Static.
[b]Warning:[/b] The nature of this shape makes it extra prone to being tunneled through by (small) fast physics bodies. For example, consider a (small) rigid body [i]Ball[/i] traveling toward a static body [i]Box[/i] at high speed. If the box uses a [b]ConcavePolygonShape3D[/b] consisting of twelve triangle faces (two triangle faces for each of the six sides of the box), then the ball might end up inside the box or tunnel all the way through the box, if it goes fast enough. This is (partly) because the ball can only collide against the individual faces of the hollow box. In interactions with rigid bodies tunneling can be avoided by enabling continuous collision detection on the rigid body.
[b]Warning:[/b] Using this shape for an [Area3D] (via a [CollisionShape3D] node, created e.g. by using the [i]Create Trimesh Collision Sibling[/i] option in the [i]Mesh[/i] menu that appears when selecting a [MeshInstance3D] node) may give unexpected results: the area will only detect collisions with the triangle faces in the [ConcavePolygonShape3D] (and not with any "inside" of the shape, for example); moreover it will only detect all such collisions if [member backface_collision] is [code]true[/code].
[b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the slowest collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, using [ConvexPolygonShape3D] will perform better. For dynamic physics bodies that need concave collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. However, consider using primitive collision shapes such as [SphereShape3D] or [BoxShape3D] first.
</description>
<tutorials>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>
@@ -16,14 +19,14 @@
<method name="get_faces" qualifiers="const">
<return type="PackedVector3Array" />
<description>
Returns the faces (an array of triangles).
Returns the faces of the trimesh shape as an array of vertices. The array (of length divisible by three) is naturally divided into triples; each triple of vertices defines a triangle.
</description>
</method>
<method name="set_faces">
<return type="void" />
<param index="0" name="faces" type="PackedVector3Array" />
<description>
Sets the faces (an array of triangles).
Sets the faces of the trimesh shape from an array of vertices. The [param faces] array should be composed of triples such that each triple of vertices defines a triangle.
</description>
</method>
</methods>

View File

@@ -15,6 +15,7 @@
<return type="float" />
<param index="0" name="param" type="int" enum="ConeTwistJoint3D.Param" />
<description>
Returns the value of the specified parameter.
</description>
</method>
<method name="set_param">
@@ -22,6 +23,7 @@
<param index="0" name="param" type="int" enum="ConeTwistJoint3D.Param" />
<param index="1" name="value" type="float" />
<description>
Sets the value of the specified parameter.
</description>
</method>
</methods>

View File

@@ -399,7 +399,7 @@
<return type="float" />
<param index="0" name="offset" type="int" enum="Side" />
<description>
Returns the anchor for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
Returns the offset for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top].
</description>
</method>
<method name="get_parent_area_size" qualifiers="const">
@@ -840,7 +840,7 @@
<param index="0" name="side" type="int" enum="Side" />
<param index="1" name="neighbor" type="NodePath" />
<description>
Sets the anchor for the specified [enum Side] to the [Control] at [param neighbor] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
Sets the focus neighbor for the specified [enum Side] to the [Control] at [param neighbor] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
</description>
</method>
<method name="set_global_position">

View File

@@ -4,9 +4,11 @@
Convex polygon shape resource for 2D physics.
</brief_description>
<description>
2D convex polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). See also [CollisionPolygon2D].
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex to speed up collision detection.
[b]Performance:[/b] [ConvexPolygonShape2D] is faster to check collisions against compared to [ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [CircleShape2D] or [RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape.
2D convex polygon shape to be added as a [i]direct[/i] child of a [PhysicsBody2D] or [Area2D] using a [CollisionShape2D] node.
The shape is a [i]solid[/i] that includes all the points that it encloses, as opposed to [ConcavePolygonShape2D] which is hollow if it encloses anything. See also [CollisionPolygon2D].
The solid nature of the shape makes it well-suited for both detection and physics; in physics body interactions this allows depenetrating even those shapes which end up (e.g. due to high speed) fully inside the convex shape (similarly to primitive shapes, but unlike [ConcavePolygonShape2D]). The convexity limits the possible geometric shape of a single [ConvexPolygonShape2D]: it cannot be concave.
[b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] convex shapes. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). It can be achieved using several [ConvexPolygonShape2D] nodes or by using the [CollisionPolygon2D] node in Solids build mode. To generate a collision polygon from a sprite, select the [Sprite2D] node, go to the [b]Sprite2D[/b] menu that appears above the viewport, and choose [b]Create Polygon2D Sibling[/b].
[b]Performance:[/b] [ConvexPolygonShape2D] is faster to check collisions against compared to [ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [CircleShape2D] or [RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes.
</description>
<tutorials>
</tutorials>
@@ -15,13 +17,14 @@
<return type="void" />
<param index="0" name="point_cloud" type="PackedVector2Array" />
<description>
Based on the set of points provided, this creates and assigns the [member points] property using the convex hull algorithm. Removing all unneeded points. See [method Geometry2D.convex_hull] for details.
Based on the set of points provided, this assigns the [member points] property using the convex hull algorithm, removing all unneeded points. See [method Geometry2D.convex_hull] for details.
</description>
</method>
</methods>
<members>
<member name="points" type="PackedVector2Array" setter="set_points" getter="get_points" default="PackedVector2Array()">
The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use [method set_point_cloud] to generate a convex hull shape from concave shape points.
The polygon's list of vertices that form a convex hull. Can be in either clockwise or counterclockwise order.
[b]Warning:[/b] Only set this property to a list of points that actually form a convex hull. Use [method set_point_cloud] to generate the convex hull of an arbitrary set of points.
</member>
</members>
</class>

View File

@@ -4,9 +4,11 @@
Convex polygon shape resource for 3D physics.
</brief_description>
<description>
3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node. Unlike [ConcavePolygonShape3D], [ConvexPolygonShape3D] cannot store concave polygon shapes. [ConvexPolygonShape3D]s can be manually drawn in the editor using the [CollisionPolygon3D] node.
[b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] [ConvexPolygonShape3D]s. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). This is available in the editor by selecting the [MeshInstance3D], going to the [b]Mesh[/b] menu and choosing [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time.
[b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape.
3D convex polygon shape resource to be added as a [i]direct[/i] child of a [PhysicsBody3D] or [Area3D] using a [CollisionShape3D] node.
The shape is a [i]solid[/i] that includes all the points that it encloses, as opposed to [ConcavePolygonShape3D] which is hollow if it encloses anything. See also [CollisionPolygon3D].
The solid nature of the shape makes it well-suited for both detection and physics; in physics body interactions this allows depenetrating even those shapes which end up (e.g. due to high speed) fully inside the convex shape (similarly to primitive shapes, but unlike [ConcavePolygonShape3D] and [HeightMapShape3D]). The convexity restricts the possible geometric shape of a single [ConvexPolygonShape3D]: it cannot be concave.
[b]Convex decomposition:[/b] Concave objects' collisions can be represented accurately using [i]several[/i] convex shapes. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). It can be achieved by using several [ConvexPolygonShape3D] nodes or by using the [CollisionPolygon3D] node. To generate a collision polygon from a mesh, select the [MeshInstance3D] node, go to the [b]Mesh[/b] menu that appears above the viewport and choose [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time.
[b]Performance:[/b] [ConvexPolygonShape3D] is faster to check collisions against compared to [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] or [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes.
</description>
<tutorials>
<link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/675</link>

View File

@@ -23,8 +23,8 @@
func _process(delta):
while server.is_connection_available():
var peer : PacketPeerUDP = server.take_connection()
var dtls_peer : PacketPeerDTLS = dtls.take_connection(peer)
var peer: PacketPeerUDP = server.take_connection()
var dtls_peer: PacketPeerDTLS = dtls.take_connection(peer)
if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING:
continue # It is normal that 50% of the connections fails due to cookie exchange.
print("Peer connected!")

View File

@@ -135,7 +135,6 @@
[/csharp]
[/codeblocks]
[b]Note:[/b] Erasing elements while iterating over dictionaries is [b]not[/b] supported and will result in unpredictable behavior.
[b]Note:[/b] When declaring a dictionary with [code]const[/code], the dictionary becomes read-only. A read-only Dictionary's entries cannot be overridden at run-time. This does [i]not[/i] affect nested [Array] and [Dictionary] values.
</description>
<tutorials>
<link title="GDScript basics: Dictionary">$DOCS_URL/tutorials/scripting/gdscript/gdscript_basics.html#dictionary</link>

View File

@@ -290,7 +290,7 @@
</methods>
<members>
<member name="include_hidden" type="bool" setter="set_include_hidden" getter="get_include_hidden">
If [code]true[/code], hidden files are included when the navigating directory.
If [code]true[/code], hidden files are included when navigating the directory.
Affects [method list_dir_begin], [method get_directories] and [method get_files].
</member>
<member name="include_navigational" type="bool" setter="set_include_navigational" getter="get_include_navigational">

View File

@@ -190,7 +190,7 @@
<description>
Adds a new checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -213,7 +213,7 @@
<description>
Adds a new checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -236,7 +236,7 @@
<description>
Adds a new item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -259,7 +259,7 @@
<description>
Adds a new radio-checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
@@ -282,7 +282,7 @@
<description>
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -307,7 +307,7 @@
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. Each press or activate of the item will increase the state by one. The default value is defined by [param default_state].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] By default, there's no indication of the current item state, it should be changed manually.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
@@ -330,7 +330,7 @@
<description>
Adds a new radio-checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
@@ -507,7 +507,7 @@
<param index="0" name="menu_root" type="String" />
<param index="1" name="idx" type="int" />
<description>
Returns the tooltip associated with the specified index index [param idx].
Returns the tooltip associated with the specified index [param idx].
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
@@ -565,7 +565,7 @@
<param index="1" name="idx" type="int" />
<param index="2" name="keycode" type="int" enum="Key" />
<description>
Sets the accelerator of the item at index [param idx]. [param keycode] can be a single [enum Key], or a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
Sets the accelerator of the item at index [param idx]. [param keycode] can be a single [enum Key], or a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
@@ -576,7 +576,7 @@
<param index="2" name="callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. Callback is emitted when an item is pressed.
[b]Note:[/b] The [param callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
[b]Note:[/b] The [param callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the [code]tag[/code] parameter when the menu item was created.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
@@ -638,7 +638,7 @@
<param index="2" name="key_callback" type="Callable" />
<description>
Sets the callback of the item at index [param idx]. Callback is emitted when its accelerator is activated.
[b]Note:[/b] The [param key_callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the tag parameter when the menu item was created.
[b]Note:[/b] The [param key_callback] Callable needs to accept exactly one Variant parameter, the parameter passed to the Callable will be the value passed to the [code]tag[/code] parameter when the menu item was created.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
@@ -943,7 +943,7 @@
<return type="void" />
<param index="0" name="image" type="Image" />
<description>
Sets the window icon (usually displayed in the top-left corner) in the operating system's [i]native[/i] format. To use icons in the operating system's native format, use [method set_native_icon] instead.
Sets the window icon (usually displayed in the top-left corner) with an [Image]. To use icons in the operating system's native format, use [method set_native_icon] instead.
</description>
</method>
<method name="set_native_icon">
@@ -1037,8 +1037,8 @@
<param index="1" name="callable" type="Callable" />
<description>
Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
- [constant TTS_UTTERANCE_STARTED], [constant TTS_UTTERANCE_ENDED], and [constant TTS_UTTERANCE_CANCELED] callable's method should take one [int] parameter, the utterance id.
- [constant TTS_UTTERANCE_BOUNDARY] callable's method should take two [int] parameters, the index of the character and the utterance id.
- [constant TTS_UTTERANCE_STARTED], [constant TTS_UTTERANCE_ENDED], and [constant TTS_UTTERANCE_CANCELED] callable's method should take one [int] parameter, the utterance ID.
- [constant TTS_UTTERANCE_BOUNDARY] callable's method should take two [int] parameters, the index of the character and the utterance ID.
[b]Note:[/b] The granularity of the boundary callbacks is engine dependent.
[b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), macOS, and Windows.
</description>

View File

@@ -67,7 +67,7 @@
The view format in which the [EditorFileDialog] displays resources to the user.
</member>
<member name="file_mode" type="int" setter="set_file_mode" getter="get_file_mode" enum="EditorFileDialog.FileMode" default="4">
The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]
The dialog's open or save mode, which affects the selection behavior. See [enum FileMode].
</member>
<member name="filters" type="PackedStringArray" setter="set_filters" getter="get_filters" default="PackedStringArray()">
The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code]. Multiple file types can also be specified in a single filter. [code]"*.png, *.jpg, *.jpeg ; Supported Images"[/code] will show both PNG and JPEG files when selected.

View File

@@ -64,7 +64,9 @@
<return type="bool" />
<description>
Returns [code]true[/code] if the editor is marked as self-contained, [code]false[/code] otherwise. When self-contained mode is enabled, user configuration, data and cache files are saved in an [code]editor_data/[/code] folder next to the editor binary. This makes portable usage easier and ensures the Godot editor minimizes file writes outside its own folder. Self-contained mode is not available for exported projects.
Self-contained mode can be enabled by creating a file named [code]._sc_[/code] or [code]_sc_[/code] in the same folder as the editor binary while the editor is not running. See also [method get_self_contained_file].
Self-contained mode can be enabled by creating a file named [code]._sc_[/code] or [code]_sc_[/code] in the same folder as the editor binary or macOS .app bundle while the editor is not running. See also [method get_self_contained_file].
[b]Note:[/b] On macOS, quarantine flag should be manually removed before using self-contained mode, see [url=https://docs.godotengine.org/en/stable/tutorials/export/running_on_macos.html]Running on macOS[/url].
[b]Note:[/b] On macOS, placing [code]_sc_[/code] or any other file inside .app bundle will break digital signature and make it non-portable, consider placing it in the same folder as the .app bundle instead.
[b]Note:[/b] The Steam release of Godot uses self-contained mode by default.
</description>
</method>

View File

@@ -10,13 +10,13 @@
[gdscript]
extends EditorResourceConversionPlugin
func _handles(resource : Resource):
func _handles(resource: Resource):
return resource is ImageTexture
func _converts_to():
return "PortableCompressedTexture2D"
func _convert(itex : Resource):
func _convert(itex: Resource):
var ptex = PortableCompressedTexture2D.new()
ptex.create_from_image(itex.get_image(), PortableCompressedTexture2D.COMPRESSION_MODE_LOSSLESS)
return ptex

View File

@@ -87,7 +87,7 @@
<method name="get_changed_settings" qualifiers="const">
<return type="PackedStringArray" />
<description>
Gets an array of the settings which have been changed since the last save. Note that internally [code]changed_settings[/code] is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED]
Gets an array of the settings which have been changed since the last save. Note that internally [code]changed_settings[/code] is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED].
</description>
</method>
<method name="get_favorites" qualifiers="const">

View File

@@ -10,6 +10,8 @@
- If the object is a built-in resource, use the scene from its path;
- If the object is external resource or anything else, use global history.
This guessing can sometimes yield false results, so you can provide a custom context object when creating an action.
[EditorUndoRedoManager] is intended to be used by Godot editor plugins. You can obtain it using [method EditorPlugin.get_undo_redo]. For non-editor uses or plugins that don't need to integrate with the editor's undo history, use [UndoRedo] instead.
The manager's API is mostly the same as in [UndoRedo], so you can refer to its documentation for more examples. The main difference is that [EditorUndoRedoManager] uses object + method name for actions, instead of [Callable].
</description>
<tutorials>
</tutorials>

View File

@@ -124,7 +124,7 @@
<param index="0" name="remote" type="String" />
<param index="1" name="force" type="bool" />
<description>
Pushes changes to the [code]remote[/code]. Optionally, if [code]force[/code] is set to true, a force push will override the change history already present on the remote.
Pushes changes to the [param remote]. If [param force] is [code]true[/code], a force push will override the change history already present on the remote.
</description>
</method>
<method name="_remove_branch" qualifiers="virtual">

View File

@@ -277,7 +277,7 @@
[b]Note:[/b] SSR is only supported in the Forward+ rendering method, not Mobile or Compatibility.
</member>
<member name="ssr_fade_in" type="float" setter="set_ssr_fade_in" getter="get_ssr_fade_in" default="0.15">
The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection). Only positive values are valid (negative values will be clamped to [code]0.0[/code]).
The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection. Only positive values are valid (negative values will be clamped to [code]0.0[/code]).
</member>
<member name="ssr_fade_out" type="float" setter="set_ssr_fade_out" getter="get_ssr_fade_out" default="2.0">
The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to [code]0.0[/code]).

View File

@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="FileSystemDock" inherits="VBoxContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Editor dock for managing files in the project.
</brief_description>
<description>
This class is available only in [EditorPlugin]s and can't be instantiated. You can access it using [method EditorInterface.get_file_system_dock].
While FileSystemDock doesn't expose any methods for file manipulation, you can listen for various file-related signals.
</description>
<tutorials>
</tutorials>
@@ -11,49 +14,58 @@
<return type="void" />
<param index="0" name="path" type="String" />
<description>
Sets the given [param path] as currently selected, ensuring that the selected file/directory is visible.
</description>
</method>
</methods>
<signals>
<signal name="display_mode_changed">
<description>
Emitted when the user switches file display mode or split mode.
</description>
</signal>
<signal name="file_removed">
<param index="0" name="file" type="String" />
<description>
Emitted when the given [param file] was removed.
</description>
</signal>
<signal name="files_moved">
<param index="0" name="old_file" type="String" />
<param index="1" name="new_file" type="String" />
<description>
Emitted when a file is moved from [param old_file] path to [param new_file] path.
</description>
</signal>
<signal name="folder_moved">
<param index="0" name="old_folder" type="String" />
<param index="1" name="new_folder" type="String" />
<description>
Emitted when a folder is moved from [param old_folder] path to [param new_folder] path.
</description>
</signal>
<signal name="folder_removed">
<param index="0" name="folder" type="String" />
<description>
Emitted when the given [param folder] was removed.
</description>
</signal>
<signal name="inherit">
<param index="0" name="file" type="String" />
<description>
Emitted when a new scene is created that inherits the scene at [param file] path.
</description>
</signal>
<signal name="instantiate">
<param index="0" name="files" type="PackedStringArray" />
<description>
Emitted when the given scenes are being instantiated in the editor.
</description>
</signal>
<signal name="resource_removed">
<param index="0" name="resource" type="Resource" />
<description>
Emitted when an external [param resource] had its file removed.
</description>
</signal>
</signals>

View File

@@ -271,6 +271,17 @@
<description>
Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code].
Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
To print available variation axes of a variable font:
[codeblock]
var fv = FontVariation.new()
fv.set_base_font = load("res://RobotoFlex.ttf")
var variation_list = fv.get_supported_variation_list()
for tag in variation_list:
var name = TextServerManager.get_primary_interface().tag_to_name(tag)
var values = variation_list[tag]
print("variation axis: %s (%d)\n\tmin, max, default: %s" % [name, tag, values])
[/codeblock]
[b]Note:[/b] To set and get variation coordinates of a [FontVariation], use [member FontVariation.variation_opentype].
</description>
</method>
<method name="get_underline_position" qualifiers="const">

View File

@@ -22,6 +22,13 @@
GetNode("Label").AddThemeFontSizeOverride("font_size", 64);
[/csharp]
[/codeblocks]
To set the coordinate of multiple variation axes:
[codeblock]
var fv = FontVariation.new();
var ts = TextServerManager.get_primary_interface()
fv.base_font = load("res://BarlowCondensed-Regular.ttf")
fv.variation_opentype = { ts.name_to_tag("wght"): 900, ts.name_to_tag("custom_hght"): 900 }
[/codeblock]
</description>
<tutorials>
</tutorials>
@@ -40,7 +47,7 @@
Base font used to create a variation. If not set, default [Theme] font is used.
</member>
<member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]">
Array of fallback [Font]s. If not set [member base_font] fallback are ussed.
Array of fallback [Font]s to use as a substitute if a glyph is not found in this [FontVariation]. If not set, [member base_font]'s fallbacks are used instead.
</member>
<member name="opentype_features" type="Dictionary" setter="set_opentype_features" getter="get_opentype_features" default="{}">
A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
@@ -66,6 +73,8 @@
</member>
<member name="variation_opentype" type="Dictionary" setter="set_variation_opentype" getter="get_variation_opentype" default="{}">
Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url].
[b]Note:[/b] This [Dictionary] uses OpenType tags as keys. Variation axes can be identified both by tags([code]int[/code]) and names ([code]string[/code]). Some axes might be accessible by multiple names. For example, [code]wght[/code] refers to the same axis as [code]weight[/code]. Tags on the other hand are unique. To convert between names and tags, use [method TextServer.name_to_tag] and [method TextServer.tag_to_name].
[b]Note:[/b] To get available variation axes of a font, use [method Font.get_supported_variation_list].
</member>
<member name="variation_transform" type="Transform2D" setter="set_variation_transform" getter="get_variation_transform" default="Transform2D(1, 0, 0, 1, 0, 0)">
2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.

View File

@@ -31,8 +31,8 @@
Below is a sample code to help get started:
[codeblock]
func _is_in_input_hotzone(in_node, in_port, mouse_position):
var port_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
var port_pos : Vector2 = in_node.get_position() + in_node.get_connection_input_position(in_port) - port_size / 2
var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
var port_pos: Vector2 = in_node.get_position() + in_node.get_connection_input_position(in_port) - port_size / 2
var rect = Rect2(port_pos, port_size)
return rect.has_point(mouse_position)
@@ -49,8 +49,8 @@
Below is a sample code to help get started:
[codeblock]
func _is_in_output_hotzone(in_node, in_port, mouse_position):
var port_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
var port_pos : Vector2 = in_node.get_position() + in_node.get_connection_output_position(in_port) - port_size / 2
var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
var port_pos: Vector2 = in_node.get_position() + in_node.get_connection_output_position(in_port) - port_size / 2
var rect = Rect2(port_pos, port_size)
return rect.has_point(mouse_position)

View File

@@ -342,7 +342,7 @@
<theme_item name="title_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)">
Color of the title text.
</theme_item>
<theme_item name="close_h_offset" data_type="constant" type="int" default="22">
<theme_item name="close_h_offset" data_type="constant" type="int" default="12">
</theme_item>
<theme_item name="close_offset" data_type="constant" type="int" default="22">
The vertical offset of the close button.

View File

@@ -20,7 +20,7 @@
[b]Note:[/b] The image can be retrieved from an imported texture using the [method Texture2D.get_image] method, which returns a copy of the image:
[codeblock]
var texture = load("res://icon.svg")
var image : Image = texture.get_image()
var image: Image = texture.get_image()
[/codeblock]
An [ImageTexture] is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new [EditorImportPlugin].
[b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations.

View File

@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventFromWindow" inherits="InputEvent" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Base class for [Viewport]-based input events.
</brief_description>
<description>
InputEventFromWindow represents events specifically received by windows. This includes mouse events, keyboard events in focused windows or touch screen actions.
</description>
<tutorials>
</tutorials>
<members>
<member name="window_id" type="int" setter="set_window_id" getter="get_window_id" default="0">
The ID of a [Window] that received this event.
</member>
</members>
</class>

View File

@@ -4,6 +4,7 @@
Base class for touch control gestures.
</brief_description>
<description>
InputEventGesture is sent when a user performs a supported gesture on a touch screen. Gestures can't be emulated using mouse, because they typically require multi-touch.
</description>
<tutorials>
</tutorials>

View File

@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventMagnifyGesture" inherits="InputEventGesture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
[InputEvent] that represents a magnifying touch gesture.
</brief_description>
<description>
Magnify gesture is performed when the user pinches the touch screen. It's typically used for zooming.
</description>
<tutorials>
</tutorials>
<members>
<member name="factor" type="float" setter="set_factor" getter="get_factor" default="1.0">
The amount (or delta) of the event. This value is higher the faster the gesture is performed.
</member>
</members>
</class>

View File

@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventPanGesture" inherits="InputEventGesture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
[InputEvent] that represents a panning touch gesture.
</brief_description>
<description>
Pan gesture is performed when the user swipes the touch screen with two fingers. It's typically used for panning/scrolling.
</description>
<tutorials>
</tutorials>
<members>
<member name="delta" type="Vector2" setter="set_delta" getter="get_delta" default="Vector2(0, 0)">
Panning amount since last pan event.
</member>
</members>
</class>

View File

@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="InputEventShortcut" inherits="InputEvent" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
[InputEvent] that signifies a triggered keyboard [Shortcut].
</brief_description>
<description>
InputEventShortcut is a special event that can be received in [method Node._unhandled_key_input]. It's typically sent by the editor's Command Palette to trigger actions, but can also be sent manually using [method Viewport.push_unhandled_input].
</description>
<tutorials>
</tutorials>
<members>
<member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut">
The [Shortcut] represented by this event. Its [method Shortcut.matches_event] method will always return [code]true[/code] for this event.
</member>
</members>
</class>

View File

@@ -109,7 +109,7 @@
</methods>
<members>
<member name="avoidance_enabled" type="bool" setter="set_avoidance_enabled" getter="get_avoidance_enabled" default="false">
If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [method NavigationAgent2D.set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [method set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
</member>
<member name="debug_enabled" type="bool" setter="set_debug_enabled" getter="get_debug_enabled" default="false">
If [code]true[/code] shows debug visuals for this agent.
@@ -117,7 +117,7 @@
<member name="debug_path_custom_color" type="Color" setter="set_debug_path_custom_color" getter="get_debug_path_custom_color" default="Color(1, 1, 1, 1)">
If [member debug_use_custom] is [code]true[/code] uses this color for this agent instead of global color.
</member>
<member name="debug_path_custom_line_width" type="float" setter="set_debug_path_custom_line_width" getter="get_debug_path_custom_line_width" default="1.0">
<member name="debug_path_custom_line_width" type="float" setter="set_debug_path_custom_line_width" getter="get_debug_path_custom_line_width" default="-1.0">
If [member debug_use_custom] is [code]true[/code] uses this line width for rendering paths for this agent instead of global line width.
</member>
<member name="debug_path_custom_point_size" type="float" setter="set_debug_path_custom_point_size" getter="get_debug_path_custom_point_size" default="4.0">
@@ -193,7 +193,7 @@
<signal name="velocity_computed">
<param index="0" name="safe_velocity" type="Vector2" />
<description>
Notifies when the collision avoidance velocity is calculated. Emitted by [method set_velocity]. Only emitted when [member avoidance_enabled] is true.
Notifies when the collision avoidance velocity is calculated. Emitted at the end of the physics frame in which [method set_velocity] is called. Only emitted when [member avoidance_enabled] is true.
</description>
</signal>
<signal name="waypoint_reached">

View File

@@ -112,7 +112,7 @@
The NavigationAgent height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents.
</member>
<member name="avoidance_enabled" type="bool" setter="set_avoidance_enabled" getter="get_avoidance_enabled" default="false">
If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [method NavigationAgent3D.set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
If [code]true[/code] the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [method set_velocity] is used and the processing is completed a [code]safe_velocity[/code] Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it.
</member>
<member name="debug_enabled" type="bool" setter="set_debug_enabled" getter="get_debug_enabled" default="false">
If [code]true[/code] shows debug visuals for this agent.
@@ -136,7 +136,7 @@
The maximum speed that an agent can move.
</member>
<member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
A bitfield determining what navigation layers of navigation regions this NavigationAgent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new navigation layers.
A bitfield determining what navigation layers of navigation regions this agent will use to calculate path. Changing it runtime will clear current navigation path and generate new one, according to new navigation layers.
</member>
<member name="neighbor_distance" type="float" setter="set_neighbor_distance" getter="get_neighbor_distance" default="50.0">
The distance to search for other agents.
@@ -196,7 +196,7 @@
<signal name="velocity_computed">
<param index="0" name="safe_velocity" type="Vector3" />
<description>
Notifies when the collision avoidance velocity is calculated. Emitted by [method set_velocity]. Only emitted when [member avoidance_enabled] is true.
Notifies when the collision avoidance velocity is calculated. Emitted at the end of the physics frame in which [method set_velocity] is called. Only emitted when [member avoidance_enabled] is true.
</description>
</signal>
<signal name="waypoint_reached">

View File

@@ -42,6 +42,18 @@
The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script.
Returning an empty array produces no warnings.
Call [method update_configuration_warnings] when the warnings need to be updated for this node.
[codeblock]
@export var energy = 0:
set(value):
energy = value
update_configuration_warnings()
func _get_configuration_warnings():
if energy &lt; 0:
return ["Energy must be 0 or greater."]
else:
return []
[/codeblock]
</description>
</method>
<method name="_input" qualifiers="virtual">
@@ -127,7 +139,7 @@
<description>
Adds a child [param node]. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node.
If [param force_readable_name] is [code]true[/code], improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to [code]false[/code], which assigns a dummy name featuring [code]@[/code] in both situations.
If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code].The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes.
If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code]. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes.
[b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example:
[codeblocks]
[gdscript]
@@ -188,6 +200,7 @@
GetTree().CreateTween().BindNode(this);
[/csharp]
[/codeblocks]
The Tween will start automatically on the next process frame or physics frame (depending on [enum Tween.TweenProcessMode]).
</description>
</method>
<method name="duplicate" qualifiers="const">
@@ -205,7 +218,7 @@
<param index="1" name="recursive" type="bool" default="true" />
<param index="2" name="owned" type="bool" default="true" />
<description>
Finds the first descendant of this node whose name matches [param pattern] as in [method String.match].
Finds the first descendant of this node whose name matches [param pattern] as in [method String.match]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]).
[param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]).
If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched.
If [param owned] is [code]true[/code], this method only finds nodes who have an assigned [member Node.owner]. This is especially important for scenes instantiated through a script, because those scenes don't have an owner.
@@ -221,7 +234,7 @@
<param index="2" name="recursive" type="bool" default="true" />
<param index="3" name="owned" type="bool" default="true" />
<description>
Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class].
Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]).
[param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]).
[param type] will check equality or inheritance, and is case-sensitive. [code]"Object"[/code] will match a node whose type is [code]"Node"[/code] but not the other way around.
If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched.
@@ -941,8 +954,10 @@
Specific to the Android platform.
</constant>
<constant name="NOTIFICATION_WM_SIZE_CHANGED" value="1008">
Notification received from the OS when the window is resized.
</constant>
<constant name="NOTIFICATION_WM_DPI_CHANGE" value="1009">
Notification received from the OS when the screen's DPI has been changed. Only implemented on macOS.
</constant>
<constant name="NOTIFICATION_VP_MOUSE_ENTER" value="1010">
Notification received when the mouse enters the viewport.

View File

@@ -344,10 +344,13 @@
In order for [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_local_transform].
</constant>
<constant name="ROTATION_EDIT_MODE_EULER" value="0" enum="RotationEditMode">
The rotation is edited using [Vector3] Euler angles.
</constant>
<constant name="ROTATION_EDIT_MODE_QUATERNION" value="1" enum="RotationEditMode">
The rotation is edited using a [Quaternion].
</constant>
<constant name="ROTATION_EDIT_MODE_BASIS" value="2" enum="RotationEditMode">
The rotation is edited using a [Basis]. In this mode, [member scale] can't be edited separately.
</constant>
</constants>
</class>

View File

@@ -141,7 +141,7 @@
<return type="StringName" />
<param index="0" name="idx" type="int" />
<description>
Gets the resource or property name indicated by [param idx] (0 to [method get_subname_count]).
Gets the resource or property name indicated by [param idx] (0 to [method get_subname_count] - 1).
[codeblocks]
[gdscript]
var node_path = NodePath("Path2D/PathFollow2D/Sprite2D:texture:load_path")

View File

@@ -4,7 +4,7 @@
Operating System functions.
</brief_description>
<description>
Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc.
Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the video driver, delays, environment variables, execution of binaries, command line, etc.
[b]Note:[/b] In Godot 4, [OS] functions related to window management were moved to the [DisplayServer] singleton.
</description>
<tutorials>
@@ -634,6 +634,7 @@
- [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
- [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://datatracker.ietf.org/doc/html/rfc2368]RFC 2368 - The [code]mailto[/code] URL scheme[/url] for a list of fields that can be added.
Use [method ProjectSettings.globalize_path] to convert a [code]res://[/code] or [code]user://[/code] path into a system path for use with this method.
[b]Note:[/b] Use [method String.uri_encode] to encode characters within URLs in a URL-safe, portable way. This is especially required for line breaks. Otherwise, [method shell_open] may not work correctly in a project exported to the Web platform.
[b]Note:[/b] This method is implemented on Android, iOS, Web, Linux, macOS and Windows.
</description>
</method>

View File

@@ -285,11 +285,11 @@
Enables and disables Turbulence for the particle system.
</member>
<member name="turbulence_influence_max" type="float" setter="set_param_max" getter="get_param_max" default="0.1">
Minimum turbulence influence on each particle.
The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life].
Maximum turbulence influence on each particle.
The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life].
</member>
<member name="turbulence_influence_min" type="float" setter="set_param_min" getter="get_param_min" default="0.1">
Maximum turbulence influence on each particle.
Minimum turbulence influence on each particle.
The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life].
</member>
<member name="turbulence_influence_over_life" type="Texture2D" setter="set_param_texture" getter="get_param_texture">

View File

@@ -21,7 +21,7 @@
</description>
</method>
<method name="collide_shape">
<return type="PackedVector2Array[]" />
<return type="Vector2[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters2D" />
<param index="1" name="max_results" type="int" default="32" />
<description>

View File

@@ -21,7 +21,7 @@
</description>
</method>
<method name="collide_shape">
<return type="PackedVector3Array[]" />
<return type="Vector3[]" />
<param index="0" name="parameters" type="PhysicsShapeQueryParameters3D" />
<param index="1" name="max_results" type="int" default="32" />
<description>

View File

@@ -119,6 +119,13 @@
<param index="0" name="area" type="RID" />
<param index="1" name="callback" type="Callable" />
<description>
Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters:
1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area,
2. an [RID] [code]area_rid[/code]: the [RID] of the other area that entered or exited the area,
3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the other area,
4. an integer [code]area_shape_idx[/code]: the index of the shape of the other area that entered or exited the area,
5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the other area entered or exited.
By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time.
</description>
</method>
<method name="area_set_collision_layer">
@@ -142,12 +149,13 @@
<param index="0" name="area" type="RID" />
<param index="1" name="callback" type="Callable" />
<description>
Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on whether the object entered or exited the area.
2: [RID] of the object that entered/exited the area.
3: Instance ID of the object that entered/exited the area.
4: The shape index of the object that entered/exited the area.
5: The shape index of the area where the object entered/exited.
Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters:
1. an integer [code]status[/code]: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area,
2. an [RID] [code]body_rid[/code]: the [RID] of the body that entered or exited the area,
3. an integer [code]instance_id[/code]: the [code]ObjectID[/code] attached to the body,
4. an integer [code]body_shape_idx[/code]: the index of the shape of the body that entered or exited the area,
5. an integer [code]self_shape_idx[/code]: the index of the shape of the area where the body entered or exited.
By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time.
</description>
</method>
<method name="area_set_monitorable">

View File

@@ -72,11 +72,13 @@
If [code]true[/code], polygon edges will be anti-aliased.
</member>
<member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[]">
Internal list of [Bone2D] nodes used by the assigned [member skeleton]. Edited using the Polygon2D editor ("UV" button on the top toolbar).
</member>
<member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
The polygon's fill color. If [code]texture[/code] is defined, it will be multiplied by this color. It will also be the default color for vertices not set in [code]vertex_colors[/code].
</member>
<member name="internal_vertex_count" type="int" setter="set_internal_vertex_count" getter="get_internal_vertex_count" default="0">
Number of internal vertices, used for UV mapping.
</member>
<member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" default="100.0">
Added padding applied to the bounding box when [member invert_enabled] is set to [code]true[/code]. Setting this value too small may result in a "Bad Polygon" error.
@@ -95,6 +97,7 @@
The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in.
</member>
<member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath(&quot;&quot;)">
Path to a [Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or invalid, skeletal deformations will not be used.
</member>
<member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
The polygon's fill texture. Use [code]uv[/code] to set texture coordinates.

View File

@@ -192,7 +192,7 @@
<return type="int" enum="Key" />
<param index="0" name="index" type="int" />
<description>
Returns the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The return value is an integer which is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). If no accelerator is defined for the specified [param index], [method get_item_accelerator] returns [code]0[/code] (corresponding to [constant @GlobalScope.KEY_NONE]).
Returns the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The return value is an integer which is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). If no accelerator is defined for the specified [param index], [method get_item_accelerator] returns [code]0[/code] (corresponding to [constant @GlobalScope.KEY_NONE]).
</description>
</method>
<method name="get_item_icon" qualifiers="const">
@@ -345,7 +345,7 @@
<param index="0" name="index" type="int" />
<param index="1" name="accel" type="int" enum="Key" />
<description>
Sets the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. [param accel] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
Sets the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. [param accel] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
</description>
</method>
<method name="set_item_as_checkable">

View File

@@ -241,6 +241,9 @@
<member name="application/boot_splash/use_filter" type="bool" setter="" getter="" default="true">
If [code]true[/code], applies linear filtering when scaling the image (recommended for high-resolution artwork). If [code]false[/code], uses nearest-neighbor interpolation (recommended for pixel art).
</member>
<member name="application/config/auto_accept_quit" type="bool" setter="" getter="" default="true">
If [code]true[/code], the application automatically accepts quitting requests.
</member>
<member name="application/config/custom_user_dir_name" type="String" setter="" getter="" default="&quot;&quot;">
This user directory is used for storing persistent data ([code]user://[/code] filesystem). If a custom directory name is defined, this name will be appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]).
The [member application/config/use_custom_user_dir] setting must be enabled for this to take effect.
@@ -248,9 +251,6 @@
<member name="application/config/description" type="String" setter="" getter="" default="&quot;&quot;">
The project's description, displayed as a tooltip in the Project Manager when hovering the project.
</member>
<member name="application/config/features" type="PackedStringArray" setter="" getter="">
List of internal features associated with the project, like [code]Double Precision[/code] or [code]C#[/code]. Not to be confused with feature tags.
</member>
<member name="application/config/icon" type="String" setter="" getter="" default="&quot;&quot;">
Icon used for the project, set when project loads. Exporters will also use this icon when possible.
</member>
@@ -268,6 +268,9 @@
Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. See "Overriding" in the [ProjectSettings] class description at the top for more information.
[b]Note:[/b] Regardless of this setting's value, [code]res://override.cfg[/code] will still be read to override the project settings.
</member>
<member name="application/config/quit_on_go_back" type="bool" setter="" getter="" default="true">
If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
</member>
<member name="application/config/use_custom_user_dir" type="bool" setter="" getter="" default="false">
If [code]true[/code], the project will save user data to its own user directory. If [member application/config/custom_user_dir_name] is empty, [code]&lt;OS user data directory&gt;/&lt;project name&gt;[/code] directory will be used. If [code]false[/code], the project will save user data to [code]&lt;OS user data directory&gt;/Godot/app_userdata/&lt;project name&gt;[/code].
See also [url=$DOCS_URL/tutorials/io/data_paths.html#accessing-persistent-user-data-user]File paths in Godot projects[/url]. This setting is only effective on desktop platforms.
@@ -308,6 +311,9 @@
<member name="application/run/low_processor_mode_sleep_usec" type="int" setter="" getter="" default="6900">
Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
</member>
<member name="application/run/main_loop_type" type="String" setter="" getter="" default="&quot;SceneTree&quot;">
The name of the type implementing the engine's main loop.
</member>
<member name="application/run/main_scene" type="String" setter="" getter="" default="&quot;&quot;">
Path to the main scene file that will be loaded when the project runs.
</member>
@@ -701,6 +707,15 @@
On desktop platforms, overrides the game's initial window width. See also [member display/window/size/window_height_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height].
[b]Note:[/b] By default, or when set to [code]0[/code], the initial window width is the viewport [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and Web.
</member>
<member name="display/window/stretch/aspect" type="String" setter="" getter="" default="&quot;keep&quot;">
</member>
<member name="display/window/stretch/mode" type="String" setter="" getter="" default="&quot;disabled&quot;">
</member>
<member name="display/window/stretch/scale" type="float" setter="" getter="" default="1.0">
</member>
<member name="display/window/subwindows/embed_subwindows" type="bool" setter="" getter="" default="true">
If [code]true[/code] subwindows are embedded in the main window.
</member>
<member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1">
Sets the V-Sync mode for the main game window.
See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application.
@@ -715,6 +730,14 @@
Directory that contains the [code].sln[/code] file. By default, the [code].sln[/code] files is in the root of the project directory, next to the [code]project.godot[/code] and [code].csproj[/code] files.
Changing this value allows setting up a multi-project scenario where there are multiple [code].csproj[/code]. Keep in mind that the Godot project is considered one of the C# projects in the workspace and it's root directory should contain the [code]project.godot[/code] and [code].csproj[/code] next to each other.
</member>
<member name="editor/export/convert_text_resources_to_binary" type="bool" setter="" getter="" default="true">
If [code]true[/code] text resources are converted to binary format on export.
</member>
<member name="editor/import/reimport_missing_imported_files" type="bool" setter="" getter="" default="true">
</member>
<member name="editor/import/use_multiple_threads" type="bool" setter="" getter="" default="true">
If [code]true[/code] importing of resources is run on multiple threads.
</member>
<member name="editor/movie_writer/disable_vsync" type="bool" setter="" getter="" default="false">
If [code]true[/code], requests V-Sync to be disabled when writing a movie (similar to setting [member display/window/vsync/vsync_mode] to [b]Disabled[/b]). This can speed up video writing if the hardware is fast enough to render, encode and save the video at a framerate higher than the monitor's refresh rate.
[b]Note:[/b] [member editor/movie_writer/disable_vsync] has no effect if the operating system or graphics driver forces V-Sync with no way for applications to disable it.
@@ -753,6 +776,9 @@
<member name="editor/naming/node_name_num_separator" type="int" setter="" getter="" default="0">
What to use to separate node name from number. This is mostly an editor setting.
</member>
<member name="editor/naming/scene_name_casing" type="int" setter="" getter="" default="2">
When generating file names from scene root node, set the type of casing in this project. This is mostly an editor setting.
</member>
<member name="editor/run/main_run_args" type="String" setter="" getter="" default="&quot;&quot;">
The command-line arguments to append to Godot's own command line when running the project. This doesn't affect the editor itself.
It is possible to make another executable run Godot by using the [code]%command%[/code] placeholder. The placeholder will be replaced with Godot's own command line. Program-specific arguments should be placed [i]before[/i] the placeholder, whereas Godot-specific arguments should be placed [i]after[/i] the placeholder.
@@ -767,6 +793,10 @@
<member name="editor/script/templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path.
</member>
<member name="editor/version_control/autoload_on_startup" type="bool" setter="" getter="" default="false">
</member>
<member name="editor/version_control/plugin_name" type="String" setter="" getter="" default="&quot;&quot;">
</member>
<member name="filesystem/import/blender/enabled" type="bool" setter="" getter="" default="true">
If [code]true[/code], Blender 3D scene files with the [code].blend[/code] extension will be imported by converting them to glTF 2.0.
This requires configuring a path to a Blender executable in the editor settings at [code]filesystem/import/blender/blender3_path[/code]. Blender 3.0 or later is required.
@@ -790,6 +820,8 @@
<member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0">
Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden.
</member>
<member name="gui/common/snap_controls_to_pixels" type="bool" setter="" getter="" default="true">
</member>
<member name="gui/common/swap_cancel_ok" type="bool" setter="" getter="">
If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows and UWP to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time.
[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show].
@@ -797,6 +829,8 @@
<member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024">
Maximum undo/redo history size for [TextEdit] fields.
</member>
<member name="gui/fonts/dynamic_fonts/use_oversampling" type="bool" setter="" getter="" default="true">
</member>
<member name="gui/theme/custom" type="String" setter="" getter="" default="&quot;&quot;">
Path to a custom [Theme] resource file to use for the project ([code].theme[/code] or generic [code].tres[/code]/[code].res[/code] extension).
</member>
@@ -1161,12 +1195,6 @@
<member name="internationalization/locale/test" type="String" setter="" getter="" default="&quot;&quot;">
If non-empty, this locale will be used when running the project from the editor.
</member>
<member name="internationalization/locale/translation_remaps" type="PackedStringArray" setter="" getter="">
Locale-dependent resource remaps. Edit them in the "Localization" tab of Project Settings editor.
</member>
<member name="internationalization/locale/translations" type="PackedStringArray" setter="" getter="">
List of translation files available in the project. Edit them in the "Localization" tab of Project Settings editor.
</member>
<member name="internationalization/pseudolocalization/double_vowels" type="bool" setter="" getter="" default="false">
Double vowels in strings during pseudolocalization to simulate the lengthening of text due to localization.
</member>
@@ -1196,7 +1224,10 @@
[b]Note:[/b] This property is only read when the project starts. To toggle pseudolocalization at run-time, use [member TranslationServer.pseudolocalization_enabled] instead.
</member>
<member name="internationalization/rendering/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false">
Force layout direction and text writing direction to RTL for all locales.
Force layout direction and text writing direction to RTL for all controls.
</member>
<member name="internationalization/rendering/root_node_layout_direction" type="int" setter="" getter="" default="0">
Root node default layout direction.
</member>
<member name="internationalization/rendering/text_driver" type="String" setter="" getter="" default="&quot;&quot;">
Specifies the [TextServer] to use. If left empty, the default will be used.
@@ -1927,8 +1958,10 @@
<member name="rendering/2d/shadow_atlas/size" type="int" setter="" getter="" default="2048">
</member>
<member name="rendering/2d/snap/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false">
If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect.
</member>
<member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false">
If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Only affects the final vertex positions, not the transforms.
</member>
<member name="rendering/anti_aliasing/quality/msaa_2d" type="int" setter="" getter="" default="0">
Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. This has no effect on shader-induced aliasing or texture aliasing.
@@ -2315,6 +2348,12 @@
Lower-end override for [member rendering/shading/overrides/force_vertex_shading] on mobile devices, due to performance concerns or driver support.
[b]Note:[/b] This setting currently has no effect, as vertex shading is not implemented yet.
</member>
<member name="rendering/textures/canvas_textures/default_texture_filter" type="int" setter="" getter="" default="1">
The default texture filtering mode to use on [CanvasItem]s.
</member>
<member name="rendering/textures/canvas_textures/default_texture_repeat" type="int" setter="" getter="" default="0">
The default texture repeating mode to use on [CanvasItem]s.
</member>
<member name="rendering/textures/decals/filter" type="int" setter="" getter="" default="3">
The filtering quality to use for [Decal] nodes. When using one of the anisotropic filtering modes, the anisotropic filtering level is controlled by [member rendering/textures/default_filters/anisotropic_filtering_level].
</member>
@@ -2379,6 +2418,7 @@
<member name="threading/worker_pool/low_priority_thread_ratio" type="float" setter="" getter="" default="0.3">
</member>
<member name="threading/worker_pool/max_threads" type="int" setter="" getter="" default="-1">
Maximum number of threads to be used by [WorkerThreadPool]. Value of [code]-1[/code] means no limit.
</member>
<member name="threading/worker_pool/use_system_threads_for_low_priority_tasks" type="bool" setter="" getter="" default="true">
</member>
@@ -2394,6 +2434,9 @@
<member name="xr/openxr/reference_space" type="int" setter="" getter="" default="&quot;1&quot;">
Specify the default reference space.
</member>
<member name="xr/openxr/startup_alert" type="bool" setter="" getter="" default="true">
If [code]true[/code], Godot will display an alert modal when OpenXR initialization fails on startup.
</member>
<member name="xr/openxr/submit_depth_buffer" type="bool" setter="" getter="" default="false">
If [code]true[/code], OpenXR will manage the depth buffer and use the depth buffer for advanced reprojection provided this is supported by the XR runtime. Note that some rendering features in Godot can't be used with this feature.
</member>

View File

@@ -31,6 +31,7 @@
<param index="0" name="arc_from" type="Vector3" />
<param index="1" name="arc_to" type="Vector3" />
<description>
Constructs a quaternion representing the shortest arc between two points on the surface of a sphere with a radius of [code]1.0[/code].
</description>
</constructor>
<constructor name="Quaternion">

View File

@@ -33,6 +33,7 @@
<description>
Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_attributes_[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [CameraAttributes] resource.
</description>
</method>
<method name="camera_attributes_set_auto_exposure">
@@ -100,6 +101,7 @@
<description>
Creates a camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [Camera3D] node.
</description>
</method>
<method name="camera_set_camera_attributes">
@@ -178,6 +180,7 @@
<description>
Creates a canvas and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
Canvas has no [Resource] or [Node] equivalent.
</description>
</method>
<method name="canvas_item_add_animation_slice">
@@ -350,6 +353,7 @@
<param index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
<param index="5" name="transpose" type="bool" default="false" />
<description>
Draws a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect] and [method Texture2D.draw_rect].
</description>
</method>
<method name="canvas_item_add_texture_rect_region">
@@ -362,6 +366,7 @@
<param index="5" name="transpose" type="bool" default="false" />
<param index="6" name="clip_uv" type="bool" default="true" />
<description>
Draws the specified region of a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect_region] and [method Texture2D.draw_rect_region].
</description>
</method>
<method name="canvas_item_add_triangle_array">
@@ -388,7 +393,9 @@
<method name="canvas_item_create">
<return type="RID" />
<description>
Creates a new [CanvasItem] instance and returns its [RID].
Creates a canvas item and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_item_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [CanvasItem] node.
</description>
</method>
<method name="canvas_item_set_canvas_group_mode">
@@ -482,6 +489,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Sets a color modulation to the [CanvasItem]. This also affects child canvas items.
</description>
</method>
<method name="canvas_item_set_parent">
@@ -489,6 +497,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="parent" type="RID" />
<description>
Sets a parent [CanvasItem] to the [CanvasItem]. The item will inherit transform, modulation and visibility from its parent, like [CanvasItem] nodes in the scene tree.
</description>
</method>
<method name="canvas_item_set_self_modulate">
@@ -496,6 +505,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Sets a color self-modulation to the [CanvasItem]. It does not affect the child canvas items.
</description>
</method>
<method name="canvas_item_set_sort_children_by_y">
@@ -503,6 +513,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="enabled" type="bool" />
<description>
Enables or disables Y-sorting of a [CanvasItem].
</description>
</method>
<method name="canvas_item_set_transform">
@@ -510,6 +521,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="transform" type="Transform2D" />
<description>
Sets the transform of the [CanvasItem]. It affects where and how the item will be drawn. Child canvas items' transforms are multiplied by their parent's transform.
</description>
</method>
<method name="canvas_item_set_use_parent_material">
@@ -536,6 +548,8 @@
<param index="3" name="enter_callable" type="Callable" />
<param index="4" name="exit_callable" type="Callable" />
<description>
Sets the given [CanvasItem] as visibility notifier. [param area] defines the area of detecting visibility. [param enter_callable] is called when the [CanvasItem] enters the screen, [param exit_callable] is called when the [CanvasItem] exits the screen. If [param enable] is [code]false[/code], the item will no longer function as notifier.
This method can be used to manually mimic [VisibleOnScreenNotifier2D].
</description>
</method>
<method name="canvas_item_set_visible">
@@ -543,6 +557,7 @@
<param index="0" name="item" type="RID" />
<param index="1" name="visible" type="bool" />
<description>
Sets the visibility of the [CanvasItem].
</description>
</method>
<method name="canvas_item_set_z_as_relative_to_parent">
@@ -587,7 +602,7 @@
<method name="canvas_light_occluder_create">
<return type="RID" />
<description>
Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_ocluder_*[/code] RenderingServer functions.
Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_occluder_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
</description>
</method>
@@ -832,6 +847,9 @@
<method name="canvas_texture_create">
<return type="RID" />
<description>
Creates a canvas texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_texture_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [CanvasTexture] resource.
</description>
</method>
<method name="canvas_texture_set_channel">
@@ -855,6 +873,7 @@
<param index="0" name="canvas_texture" type="RID" />
<param index="1" name="filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" />
<description>
Sets the texture filter used by the [CanvasTexture].
</description>
</method>
<method name="canvas_texture_set_texture_repeat">
@@ -862,6 +881,7 @@
<param index="0" name="canvas_texture" type="RID" />
<param index="1" name="repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" />
<description>
Sets the texture repeat used by the [CanvasTexture].
</description>
</method>
<method name="create_local_rendering_device" qualifiers="const">
@@ -874,6 +894,9 @@
<method name="decal_create">
<return type="RID" />
<description>
Creates a decal and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]decal_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [Decal] node.
</description>
</method>
<method name="decal_set_albedo_mix">
@@ -919,6 +942,7 @@
<param index="0" name="decal" type="RID" />
<param index="1" name="color" type="Color" />
<description>
Sets the color modulation of the [Decal].
</description>
</method>
<method name="decal_set_normal_fade">
@@ -933,6 +957,7 @@
<param index="0" name="decal" type="RID" />
<param index="1" name="size" type="Vector3" />
<description>
Sets the size of the [Decal].
</description>
</method>
<method name="decal_set_texture">
@@ -941,6 +966,7 @@
<param index="1" name="type" type="int" enum="RenderingServer.DecalTexture" />
<param index="2" name="texture" type="RID" />
<description>
Sets the texture of the [Decal].
</description>
</method>
<method name="decals_set_filter">
@@ -955,6 +981,7 @@
Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID.
This is the internal equivalent of the [DirectionalLight3D] node.
</description>
</method>
<method name="directional_shadow_atlas_set_size">
@@ -983,6 +1010,7 @@
<description>
Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]environment_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [Environment] resource.
</description>
</method>
<method name="environment_glow_set_use_bicubic_upscale">
@@ -1244,7 +1272,9 @@
<method name="fog_volume_create">
<return type="RID" />
<description>
Creates a new fog volume and allocates an RID.
Creates a fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]fog_volume_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [FogVolume] node.
</description>
</method>
<method name="fog_volume_set_material">
@@ -1461,6 +1491,7 @@
Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using [method instance_set_base].
This is the internal equivalent of the [VisualInstance3D] node.
</description>
</method>
<method name="instance_create2">
@@ -1821,7 +1852,9 @@
<method name="lightmap_create">
<return type="RID" />
<description>
Creates a new [LightmapGI] instance.
Creates a lightmap GI and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [LightmapGI] node.
</description>
</method>
<method name="lightmap_get_probe_capture_bsp_tree" qualifiers="const">
@@ -1908,6 +1941,7 @@
<description>
Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]material_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
This is the internal equivalent of the [Material] resource.
</description>
</method>
<method name="material_get_param" qualifiers="const">
@@ -1982,6 +2016,7 @@
Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]mesh_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID.
This is the internal equivalent of the [Mesh] resource.
</description>
</method>
<method name="mesh_create_from_surfaces">
@@ -2154,6 +2189,7 @@
Creates a new multimesh on the RenderingServer and returns an [RID] handle. This RID will be used in all [code]multimesh_*[/code] RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method.
To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID.
This is the internal equivalent of the [MultiMesh] resource.
</description>
</method>
<method name="multimesh_get_aabb" qualifiers="const">

View File

@@ -88,7 +88,7 @@
<method name="create_tween">
<return type="Tween" />
<description>
Creates and returns a new [Tween].
Creates and returns a new [Tween]. The Tween will start automatically on the next process frame or physics frame (depending on [enum Tween.TweenProcessMode]).
</description>
</method>
<method name="get_first_node_in_group">
@@ -218,7 +218,7 @@
</methods>
<members>
<member name="auto_accept_quit" type="bool" setter="set_auto_accept_quit" getter="is_auto_accept_quit" default="true">
If [code]true[/code], the application automatically accepts quitting.
If [code]true[/code], the application automatically accepts quitting requests.
For mobile platforms, see [member quit_on_go_back].
</member>
<member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene">
@@ -249,7 +249,7 @@
- [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes.
</member>
<member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true">
If [code]true[/code], the application quits automatically on going back (e.g. on Android).
If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST].
</member>
<member name="root" type="Window" setter="" getter="get_root">

View File

@@ -23,7 +23,7 @@
When set to [code]0[/code], the default value from [member ProjectSettings.physics/3d/solver/default_contact_bias] is used.
</member>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04">
The collision margin for the shape. Used in Bullet Physics only.
The collision margin for the shape. This is not used in Godot Physics.
Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp.
</member>
</members>

View File

@@ -81,7 +81,7 @@
The [Bone2D] node that the modification will operate on.
</member>
<member name="bone_index" type="int" setter="set_bone_index" getter="get_bone_index" default="-1">
The index of the [Bone2D] node that the modification will oeprate on.
The index of the [Bone2D] node that the modification will operate on.
</member>
<member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath(&quot;&quot;)">
The NodePath to the node that is the target for the LookAt modification. This node is what the modification will rotate the [Bone2D] to.

View File

@@ -970,7 +970,7 @@
<method name="uri_decode" qualifiers="const">
<return type="String" />
<description>
Decodes the string from its URL-encoded format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request.
Decodes the string from its URL-encoded format. This method is meant to properly decode the parameters in a URL when receiving an HTTP request. See also [method uri_encode].
[codeblocks]
[gdscript]
var url = "$DOCS_URL/?highlight=Godot%20Engine%3%docs"
@@ -986,7 +986,7 @@
<method name="uri_encode" qualifiers="const">
<return type="String" />
<description>
Encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request.
Encodes the string to URL-friendly format. This method is meant to properly encode the parameters in a URL when sending an HTTP request. See also [method uri_decode].
[codeblocks]
[gdscript]
var prefix = "$DOCS_URL/?highlight="

View File

@@ -1154,7 +1154,7 @@
<param index="1" name="width" type="float" />
<param index="2" name="jst_flags" type="int" enum="TextServer.JustificationFlag" default="3" />
<description>
Adjusts text with to fit to specified width, returns new text width.
Adjusts text width to fit to specified width, returns new text width.
</description>
</method>
<method name="shaped_text_get_ascent" qualifiers="const">

View File

@@ -240,7 +240,7 @@
<param index="2" name="theme_type" type="StringName" />
<description>
Returns the theme property of [param data_type] defined by [param name] and [param theme_type], if it exists.
Returns the engine fallback icon value if the property doesn't exist (see [ThemeDB]). Use [method has_theme_item] to check for existence.
Returns the engine fallback value if the property doesn't exist (see [ThemeDB]). Use [method has_theme_item] to check for existence.
[b]Note:[/b] This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic.
</description>
</method>

View File

@@ -16,13 +16,13 @@
<method name="get_id" qualifiers="const">
<return type="String" />
<description>
Returns the current [Thread]'s ID, uniquely identifying it among all threads. If the [Thread] is not running this returns an empty string.
Returns the current [Thread]'s ID, uniquely identifying it among all threads. If the [Thread] has not started running or if [method wait_to_finish] has been called, this returns an empty string.
</description>
</method>
<method name="is_alive" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if this [Thread] is currently running. This is useful for determining if [method wait_to_finish] can be called without blocking the calling thread.
Returns [code]true[/code] if this [Thread] is currently running the provided function. This is useful for determining if [method wait_to_finish] can be called without blocking the calling thread.
To check if a [Thread] is joinable, use [method is_started].
</description>
</method>

View File

@@ -155,7 +155,7 @@
<return type="int" />
<param index="0" name="layer_index" type="int" />
<description>
Returns the navigation layers (as in the Navigation server) of the gives TileSet navigation layer.
Returns the navigation layers (as in the Navigation server) of the given TileSet navigation layer.
</description>
</method>
<method name="get_navigation_layers_count" qualifiers="const">
@@ -522,7 +522,7 @@
<param index="0" name="layer_index" type="int" />
<param index="1" name="layers" type="int" />
<description>
Sets the navigation layers (as in the navigation server) for navigation regions is the given TileSet navigation layer.
Sets the navigation layers (as in the navigation server) for navigation regions in the given TileSet navigation layer.
</description>
</method>
<method name="set_occlusion_layer_light_mask">
@@ -538,7 +538,7 @@
<param index="0" name="layer_index" type="int" />
<param index="1" name="sdf_collision" type="bool" />
<description>
Enables or disables sdf collision for occluders in the given TileSet occlusion layer.
Enables or disables SDF collision for occluders in the given TileSet occlusion layer.
</description>
</method>
<method name="set_physics_layer_collision_layer">

View File

@@ -120,7 +120,7 @@
<return type="bool" />
<param index="0" name="xform" type="Transform2D" />
<description>
Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
Returns [code]true[/code] if this transform and [param xform] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="is_finite" qualifiers="const">
@@ -133,7 +133,7 @@
<return type="Transform2D" />
<param index="0" name="target" type="Vector2" default="Vector2(0, 0)" />
<description>
Returns a copy of the transform rotated such that it's rotation on the X-axis points towards the [param target] position.
Returns a copy of the transform rotated such that the rotated X-axis points towards the [param target] position.
Operations take place in global space.
</description>
</method>
@@ -148,8 +148,7 @@
<param index="0" name="angle" type="float" />
<description>
Returns a copy of the transform rotated by the given [param angle] (in radians).
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -158,8 +157,7 @@
<param index="0" name="angle" type="float" />
<description>
Returns a copy of the transform rotated by the given [param angle] (in radians).
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -168,8 +166,7 @@
<param index="0" name="scale" type="Vector2" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -178,8 +175,7 @@
<param index="0" name="scale" type="Vector2" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -188,8 +184,7 @@
<param index="0" name="offset" type="Vector2" />
<description>
Returns a copy of the transform translated by the given [param offset].
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -198,8 +193,7 @@
<param index="0" name="offset" type="Vector2" />
<description>
Returns a copy of the transform translated by the given [param offset].
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>

View File

@@ -80,7 +80,7 @@
<return type="bool" />
<param index="0" name="xform" type="Transform3D" />
<description>
Returns [code]true[/code] if this transform and [code]transform[/code] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
Returns [code]true[/code] if this transform and [param xform] are approximately equal, by calling [code]is_equal_approx[/code] on each component.
</description>
</method>
<method name="is_finite" qualifiers="const">
@@ -111,8 +111,7 @@
<description>
Returns a copy of the transform rotated around the given [param axis] by the given [param angle] (in radians).
The [param axis] must be a normalized vector.
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the left, i.e., [code]R * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -123,8 +122,7 @@
<description>
Returns a copy of the transform rotated around the given [param axis] by the given [param angle] (in radians).
The [param axis] must be a normalized vector.
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding rotation transform [code]R[/code] from the right, i.e., [code]X * R[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -133,8 +131,7 @@
<param index="0" name="scale" type="Vector3" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the left, i.e., [code]S * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -143,8 +140,7 @@
<param index="0" name="scale" type="Vector3" />
<description>
Returns a copy of the transform scaled by the given [param scale] factor.
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding scaling transform [code]S[/code] from the right, i.e., [code]X * S[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>
@@ -153,8 +149,7 @@
<param index="0" name="offset" type="Vector3" />
<description>
Returns a copy of the transform translated by the given [param offset].
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the left, i.e., [code]T * X[/code].
This can be seen as transforming with respect to the global/parent frame.
</description>
</method>
@@ -163,8 +158,7 @@
<param index="0" name="offset" type="Vector3" />
<description>
Returns a copy of the transform translated by the given [param offset].
This method is an optimized version of multiplying the given transform [code]X[/code]
with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
This method is an optimized version of multiplying the given transform [code]X[/code] with a corresponding translation transform [code]T[/code] from the right, i.e., [code]X * T[/code].
This can be seen as transforming with respect to the local frame.
</description>
</method>

View File

@@ -156,7 +156,7 @@
<param index="2" name="n" type="int" />
<param index="3" name="context" type="StringName" default="&quot;&quot;" />
<description>
Returns the current locale's translation for the given message (key), plural_message and context.
Returns the current locale's translation for the given message (key), plural message and context.
The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language.
</description>
</method>

View File

@@ -89,8 +89,8 @@
[/codeblocks]
Some [Tweener]s use transitions and eases. The first accepts a [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best.
[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url]
[b]Note:[/b] All [Tween]s will automatically start by default. To prevent a [Tween] from autostarting, you can call [method stop] immediately after it is created.
[b]Note:[/b] [Tween]s are processing after all of nodes in the current frame, i.e. after [method Node._process] or [method Node._physics_process] (depending on [enum TweenProcessMode]).
[b]Note:[/b] Tweens are not designed to be re-used and trying to do so results in an undefined behavior. Create a new Tween for each animation and every time you replay an animation from start. Keep in mind that Tweens start immediately, so only create a Tween when you want to start animating.
[b]Note:[/b] Tweens are processing after all of nodes in the current frame, i.e. after [method Node._process] or [method Node._physics_process] (depending on [enum TweenProcessMode]).
</description>
<tutorials>
</tutorials>
@@ -129,7 +129,6 @@
<description>
Processes the [Tween] by the given [param delta] value, in seconds. This is mostly useful for manual control when the [Tween] is paused. It can also be used to end the [Tween] animation immediately, by setting [param delta] longer than the whole duration of the [Tween] animation.
Returns [code]true[/code] if the [Tween] still has [Tweener]s that haven't finished.
[b]Note:[/b] The [Tween] will become invalid in the next processing frame after its animation finishes. Calling [method stop] after performing [method custom_step] instead keeps and resets the [Tween].
</description>
</method>
<method name="get_total_elapsed_time" qualifiers="const">
@@ -432,7 +431,6 @@
<signal name="finished">
<description>
Emitted when the [Tween] has finished all tweening. Never emitted when the [Tween] is set to infinite looping (see [method set_loops]).
[b]Note:[/b] The [Tween] is removed (invalidated) in the next processing frame after this signal is emitted. Calling [method stop] inside the signal callback will prevent the [Tween] from being removed.
</description>
</signal>
<signal name="loop_finished">

View File

@@ -22,7 +22,7 @@
func _process(delta):
server.poll() # Important!
if server.is_connection_available():
var peer : PacketPeerUDP = server.take_connection()
var peer: PacketPeerUDP = server.take_connection()
var packet = peer.get_packet()
print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()])
print("Received data: %s" % [packet.get_string_from_utf8()])

View File

@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="UndoRedo" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Helper to manage undo/redo operations in the editor or custom tools.
General-purpose helper to manage undo/redo operations.
</brief_description>
<description>
Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside "actions".
UndoRedo works by registering methods and property changes inside "actions".
Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action.
Here's an example on how to add an action to the Godot editor's own [UndoRedo], from a plugin:
Here's an example on how to add an UndoRedo action:
[codeblocks]
[gdscript]
var undo_redo = get_undo_redo() # Method of EditorPlugin.
var undo_redo = UndoRedo.new()
func do_something():
pass # Put your code here.
@@ -20,8 +20,8 @@
func _on_my_button_pressed():
var node = get_node("MyNode2D")
undo_redo.create_action("Move the node")
undo_redo.add_do_method(self, "do_something")
undo_redo.add_undo_method(self, "undo_something")
undo_redo.add_do_method(do_something)
undo_redo.add_undo_method(undo_something)
undo_redo.add_do_property(node, "position", Vector2(100,100))
undo_redo.add_undo_property(node, "position", node.position)
undo_redo.commit_action()
@@ -31,7 +31,7 @@
public override void _Ready()
{
_undoRedo = GetUndoRedo(); // Method of EditorPlugin.
_undoRedo = new UndoRedo();
}
public void DoSomething()
@@ -58,6 +58,7 @@
[/codeblocks]
[method create_action], [method add_do_method], [method add_undo_method], [method add_do_property], [method add_undo_property], and [method commit_action] should be called one after the other, like in the example. Not doing so could lead to crashes.
If you don't need to register a method, you can leave [method add_do_method] and [method add_undo_method] out; the same goes for properties. You can also register more than one method/property.
If you are making an [EditorPlugin] and want to integrate into the editor's undo history, use [EditorUndoRedoManager] instead.
</description>
<tutorials>
</tutorials>
@@ -83,6 +84,14 @@
<param index="0" name="object" type="Object" />
<description>
Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources.
[codeblock]
var node = Node2D.new()
undo_redo.create_action("Add node")
undo_redo.add_do_method(add_child.bind(node))
undo_redo.add_do_reference(node)
undo_redo.add_undo_method(remove_child.bind(node))
undo_redo.commit_action()
[/codeblock]
</description>
</method>
<method name="add_undo_method">
@@ -106,6 +115,14 @@
<param index="0" name="object" type="Object" />
<description>
Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!).
[codeblock]
var node = $Node2D
undo_redo.create_action("Remove node")
undo_redo.add_do_method(remove_child.bind(node))
undo_redo.add_undo_method(add_child.bind(node))
undo_redo.add_undo_reference(node)
undo_redo.commit_action()
[/codeblock]
</description>
</method>
<method name="clear_history">

View File

@@ -143,7 +143,7 @@
<param index="2" name="post_b" type="Vector2" />
<param index="3" name="weight" type="float" />
<description>
Cubically interpolates between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
Performs a cubic interpolation between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
</description>
</method>
<method name="cubic_interpolate_in_time" qualifiers="const">
@@ -156,7 +156,7 @@
<param index="5" name="pre_a_t" type="float" />
<param index="6" name="post_b_t" type="float" />
<description>
Cubically interpolates between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
Performs a cubic interpolation between this vector and [param b] using [param pre_a] and [param post_b] as handles, and returns the result at position [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
It can perform smoother interpolation than [code]cubic_interpolate()[/code] by the time values.
</description>
</method>
@@ -226,7 +226,7 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the vector is normalized, [code]false[/code] otherwise.
Returns [code]true[/code] if the vector is normalized, i.e. its length is approximately equal to 1.
</description>
</method>
<method name="is_zero_approx" qualifiers="const">
@@ -254,7 +254,7 @@
<param index="0" name="to" type="Vector2" />
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
</description>
</method>
<method name="limit_length" qualifiers="const">
@@ -287,7 +287,8 @@
<method name="normalized" qualifiers="const">
<return type="Vector2" />
<description>
Returns a new vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
[b]Note:[/b] This function may return incorrect values if the initial vector length is near zero.
</description>
</method>
<method name="orthogonal" qualifiers="const">

View File

@@ -194,7 +194,7 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the vector is [method normalized], [code]false[/code] otherwise.
Returns [code]true[/code] if the vector is normalized, i.e. its length is approximately equal to 1.
</description>
</method>
<method name="is_zero_approx" qualifiers="const">
@@ -222,7 +222,7 @@
<param index="0" name="to" type="Vector3" />
<param index="1" name="weight" type="float" />
<description>
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of 0.0 to 1.0, representing the amount of interpolation.
Returns the result of the linear interpolation between this vector and [param to] by amount [param weight]. [param weight] is on the range of [code]0.0[/code] to [code]1.0[/code], representing the amount of interpolation.
</description>
</method>
<method name="limit_length" qualifiers="const">
@@ -255,7 +255,8 @@
<method name="normalized" qualifiers="const">
<return type="Vector3" />
<description>
Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
[b]Note:[/b] This function may return incorrect values if the input vector length is near zero.
</description>
</method>
<method name="octahedron_decode" qualifiers="static">

View File

@@ -145,7 +145,7 @@
<method name="is_normalized" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the vector is normalized, i.e. its length is equal to 1.
Returns [code]true[/code] if the vector is normalized, i.e. its length is approximately equal to 1.
</description>
</method>
<method name="is_zero_approx" qualifiers="const">
@@ -190,7 +190,8 @@
<method name="normalized" qualifiers="const">
<return type="Vector4" />
<description>
Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code].
Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
[b]Note:[/b] This function may return incorrect values if the input vector length is near zero.
</description>
</method>
<method name="posmod" qualifiers="const">

View File

@@ -76,6 +76,7 @@
<param index="0" name="type" type="int" enum="Viewport.RenderInfoType" />
<param index="1" name="info" type="int" enum="Viewport.RenderInfo" />
<description>
Returns rendering statistics of the given type. See [enum RenderInfoType] and [enum RenderInfo] for options.
</description>
</method>
<method name="get_screen_transform" qualifiers="const">
@@ -165,6 +166,7 @@
<return type="void" />
<param index="0" name="text" type="String" />
<description>
Helper method which calls the [code]set_text()[/code] method on the currently focused [Control], provided that it is defined (e.g. if the focused Control is [Button] or [LineEdit]).
</description>
</method>
<method name="push_unhandled_input">

View File

@@ -530,7 +530,7 @@
[b]Note:[/b] Fullscreen mode is not exclusive full screen on Windows and Linux.
</member>
<member name="mouse_passthrough" type="bool" setter="set_flag" getter="get_flag" default="false">
If [code]true[/code], all mouse event as passed to the underlying window of the same application. See also [member mouse_passthrough_polygon].
If [code]true[/code], all mouse events will be passed to the underlying window of the same application. See also [member mouse_passthrough_polygon].
[b]Note:[/b] This property is implemented on Linux (X11), macOS and Windows.
</member>
<member name="mouse_passthrough_polygon" type="PackedVector2Array" setter="set_mouse_passthrough_polygon" getter="get_mouse_passthrough_polygon" default="PackedVector2Array()">
@@ -582,7 +582,7 @@
The window's title. If the [Window] is non-embedded, title styles set in [Theme] will have no effect.
</member>
<member name="transient" type="bool" setter="set_transient" getter="is_transient" default="false">
If [code]true[/code], the [Window] is transient, i.e. it's considered a child of another [Window]. Transient window is will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
If [code]true[/code], the [Window] is transient, i.e. it's considered a child of another [Window]. The transient window will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
Note that behavior might be different depending on the platform.
</member>
<member name="transparent" type="bool" setter="set_flag" getter="get_flag" default="false">
@@ -764,7 +764,7 @@
The content can be expanded horizontally. Scaling vertically will result in keeping the height ratio and then black bars on top and bottom sides.
</constant>
<constant name="CONTENT_SCALE_ASPECT_EXPAND" value="4" enum="ContentScaleAspect">
The content's aspect will be preserved. If the target size has different aspect from the base one, the content will stay in the to-left corner and add an extra visible area in the stretched space.
The content's aspect will be preserved. If the target size has different aspect from the base one, the content will stay in the top-left corner and add an extra visible area in the stretched space.
</constant>
<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
Automatic layout direction, determined from the parent window layout direction.

View File

@@ -116,9 +116,9 @@
[b]Note:[/b] Not all runtimes support all environment blend modes, so it is important to check this at startup. For example:
[codeblock]
func _ready():
var xr_interface : XRInterface = XRServer.find_interface("OpenXR")
var xr_interface: XRInterface = XRServer.find_interface("OpenXR")
if xr_interface and xr_interface.is_initialized():
var vp : Viewport = get_viewport()
var vp: Viewport = get_viewport()
vp.use_xr = true
var acceptable_modes = [ XRInterface.XR_ENV_BLEND_MODE_OPAQUE, XRInterface.XR_ENV_BLEND_MODE_ADDITIVE ]
var modes = xr_interface.get_supported_environment_blend_modes()

View File

@@ -108,6 +108,10 @@
<member name="primary_interface" type="XRInterface" setter="set_primary_interface" getter="get_primary_interface">
The primary [XRInterface] currently bound to the [XRServer].
</member>
<member name="world_origin" type="Transform3D" setter="set_world_origin" getter="get_world_origin" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)">
The current origin of our tracking space in the virtual world. This is used by the renderer to properly position the camera with new tracking data.
[b]Note:[/b] This property is managed by the current [XROrigin3D] node. It is exposed for access from GDExtensions.
</member>
<member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" default="1.0">
Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
</member>

View File

@@ -1,40 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="int" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Integer built-in type.
Built-in integer Variant type.
</brief_description>
<description>
Signed 64-bit integer type.
It can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around.
[int] is a [Variant] type, and will thus be used when assigning an integer value to a [Variant]. It can also be enforced with the [code]: int[/code] type hint.
Signed 64-bit integer type. This means that it can take values from [code]-2^63[/code] to [code]2^63 - 1[/code], i.e. from [code]-9223372036854775808[/code] to [code]9223372036854775807[/code]. When it exceeds these bounds, it will wrap around.
[int]s can be automatically converted to [float]s when necessary, for example when passing them as arguments in functions. The [float] will be as close to the original integer as possible.
Likewise, [float]s can be automatically converted into [int]s. This will truncate the [float], discarding anything after the floating point.
[b]Note:[/b] In a boolean context, an [int] will evaluate to [code]false[/code] if it equals [code]0[/code], and to [code]true[/code] otherwise.
[codeblocks]
[gdscript]
var my_variant = 0 # int, value 0.
my_variant += 4.2 # float, value 4.2.
var my_int: int = 1 # int, value 1.
my_int = 4.2 # int, value 4, the right value is implicitly cast to int.
my_int = int("6.7") # int, value 6, the String is explicitly cast with int.
var max_int = 9223372036854775807
print(max_int) # 9223372036854775807, OK.
max_int += 1
print(max_int) # -9223372036854775808, we overflowed and wrapped around.
var x: int = 1 # x is 1
x = 4.2 # x is 4, because 4.2 gets truncated
var max_int = 9223372036854775807 # Biggest value an int can store
max_int += 1 # max_int is -9223372036854775808, because it wrapped around
[/gdscript]
[csharp]
int myInt = (int)"6.7".ToFloat(); // int, value 6, the String is explicitly cast with int.
// We have to use `long` here, because GDSript's `int`
// is 64 bits long while C#'s `int` is only 32 bits.
long maxInt = 9223372036854775807;
GD.Print(maxInt); // 9223372036854775807, OK.
maxInt++;
GD.Print(maxInt); // -9223372036854775808, we overflowed and wrapped around.
int x = 1; // x is 1
x = 4.2; // x is 4, because 4.2 gets truncated
// We use long below, because GDScript's int is 64-bit while C#'s int is 32-bit.
long maxLong = 9223372036854775807; // Biggest value a long can store
maxLong++; // maxLong is now -9223372036854775808, because it wrapped around.
// Alternatively, if we used C#'s 32-bit `int` type, the maximum value is much smaller:
int halfInt = 2147483647;
GD.Print(halfInt); // 2147483647, OK.
halfInt++;
GD.Print(halfInt); // -2147483648, we overflowed and wrapped around.
// Alternatively with C#'s 32-bit int type, which has a smaller maximum value.
int maxInt = 2147483647; // Biggest value an int can store
maxInt++; // maxInt is now -2147483648, because it wrapped around
[/csharp]
[/codeblocks]
In GDScript, you can use the [code]0b[/code] literal for binary representation, the [code]0x[/code] literal for hexadecimal representation, and the [code]_[/code] symbol to separate long numbers and improve readability.
[codeblock]
var x = 0b1001 # x is 9
var y = 0xF5 # y is 245
var z = 10_000_000 # z is 10000000
[/codeblock]
</description>
<tutorials>
</tutorials>
@@ -42,7 +40,7 @@
<constructor name="int">
<return type="int" />
<description>
Constructs a default-initialized [int] set to [code]0[/code].
Constructs an [int] set to [code]0[/code].
</description>
</constructor>
<constructor name="int">
@@ -56,21 +54,21 @@
<return type="int" />
<param index="0" name="from" type="String" />
<description>
Converts a [String] to an [int], following the same rules as [method String.to_int].
Constructs a new [int] from a [String], following the same rules as [method String.to_int].
</description>
</constructor>
<constructor name="int">
<return type="int" />
<param index="0" name="from" type="bool" />
<description>
Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0.
Constructs a new [int] from a [bool]. [code]true[/code] is converted to [code]1[/code] and [code]false[/code] is converted to [code]0[/code].
</description>
</constructor>
<constructor name="int">
<return type="int" />
<param index="0" name="from" type="float" />
<description>
Cast a float value to an integer value, this method simply removes the number fractions (i.e. rounds [param from] towards zero), so for example [code]int(2.7)[/code] will be equals to 2, [code]int(0.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2. This operation is also called truncation.
Constructs a new [int] from a [float]. This will truncate the [float], discarding anything after the floating point.
</description>
</constructor>
</constructors>
@@ -79,25 +77,25 @@
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if this [int] is not equivalent to the given [float].
Returns [code]true[/code] if the [int] is not equivalent to the [float].
</description>
</operator>
<operator name="operator !=">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the integers are not equal.
Returns [code]true[/code] if the [int]s are not equal.
</description>
</operator>
<operator name="operator %">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Returns the remainder after dividing two integers. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using [method @GlobalScope.posmod] instead if you want to handle negative numbers.
Returns the remainder after dividing two [int]s. Uses truncated division, which returns a negative number if the dividend is negative. If this is not desired, consider using [method @GlobalScope.posmod].
[codeblock]
print(5 % 2) # 1
print(12 % 4) # 0
print(-5 % 3) # -2
print(6 % 2) # Prints 0
print(11 % 4) # Prints 3
print(-5 % 3) # Prints -2
[/codeblock]
</description>
</operator>
@@ -105,17 +103,16 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Returns the result of bitwise [code]AND[/code] operation for two integers.
Performs the bitwise [code]AND[/code] operation.
[codeblock]
print(3 &amp; 1) # 1
print(11 &amp; 3) # 3
print(0b1100 &amp; 0b1010) # Prints 8 (binary 1000)
[/codeblock]
It's useful to retrieve binary flags from a variable.
This is useful for retrieving binary flags from a variable.
[codeblock]
var flags = 5
# Do something if the first bit is enabled.
if flags &amp; 1:
do_stuff()
var flags = 0b101
# Check if the first or second bit are enabled.
if flags &amp; 0b011:
do_stuff() # This line will run.
[/codeblock]
</description>
</operator>
@@ -123,23 +120,23 @@
<return type="Color" />
<param index="0" name="right" type="Color" />
<description>
Multiplies each component of the [Color] by the given [int].
Multiplies each component of the [Color] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Quaternion" />
<param index="0" name="right" type="Quaternion" />
<description>
Multiplies each component of the [Quaternion] by the given [int]. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
Multiplies each component of the [Quaternion] by the [int]. This operation is not meaningful on its own, but it can be used as a part of a larger expression.
</description>
</operator>
<operator name="operator *">
<return type="Vector2" />
<param index="0" name="right" type="Vector2" />
<description>
Multiplies each component of the [Vector2] by the given [int].
Multiplies each component of the [Vector2] by the [int].
[codeblock]
print(2 * Vector2(1, 1)) # Vector2(2, 2)
print(2 * Vector2(1, 4)) # Prints (2, 8)
[/codeblock]
</description>
</operator>
@@ -147,49 +144,49 @@
<return type="Vector2i" />
<param index="0" name="right" type="Vector2i" />
<description>
Multiplies each component of the [Vector2i] by the given [int].
Multiplies each component of the [Vector2i] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector3" />
<param index="0" name="right" type="Vector3" />
<description>
Multiplies each component of the [Vector3] by the given [int].
Multiplies each component of the [Vector3] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector3i" />
<param index="0" name="right" type="Vector3i" />
<description>
Multiplies each component of the [Vector3i] by the given [int].
Multiplies each component of the [Vector3i] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector4" />
<param index="0" name="right" type="Vector4" />
<description>
Multiplies each component of the [Vector4] by the given [int].
Multiplies each component of the [Vector4] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="Vector4i" />
<param index="0" name="right" type="Vector4i" />
<description>
Multiplies each component of the [Vector4i] by the given [int].
Multiplies each component of the [Vector4i] by the [int].
</description>
</operator>
<operator name="operator *">
<return type="float" />
<param index="0" name="right" type="float" />
<description>
Multiplies an [int] and a [float]. The result is a [float].
Multiplies the [float] by the [int]. The result is a [float].
</description>
</operator>
<operator name="operator *">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Multiplies two [int]s.
Multiplies the two [int]s.
</description>
</operator>
<operator name="operator **">
@@ -198,7 +195,7 @@
<description>
Raises an [int] to a power of a [float]. The result is a [float].
[codeblock]
print(8**0.25) # 1.68179283050743
print(2 ** 0.5) # Prints 1.4142135623731
[/codeblock]
</description>
</operator>
@@ -206,9 +203,9 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Raises an [int] to a power of a [int].
Raises the left [int] to a power of the right [int].
[codeblock]
print(5**5) # 3125
print(3 ** 4) # Prints 81
[/codeblock]
</description>
</operator>
@@ -216,37 +213,37 @@
<return type="float" />
<param index="0" name="right" type="float" />
<description>
Adds an [int] and a [float]. The result is a [float].
Adds the [int] and the [float]. The result is a [float].
</description>
</operator>
<operator name="operator +">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Adds two integers.
Adds the two [int]s.
</description>
</operator>
<operator name="operator -">
<return type="float" />
<param index="0" name="right" type="float" />
<description>
Subtracts a [float] from an [int]. The result is a [float].
Subtracts the [float] from the [int]. The result is a [float].
</description>
</operator>
<operator name="operator -">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Subtracts two integers.
Subtracts the two [int]s.
</description>
</operator>
<operator name="operator /">
<return type="float" />
<param index="0" name="right" type="float" />
<description>
Divides an [int] by a [float]. The result is a [float].
Divides the [int] by the [float]. The result is a [float].
[codeblock]
print(10 / 3.0) # 3.333...
print(10 / 3.0) # Prints 3.33333333333333
[/codeblock]
</description>
</operator>
@@ -254,10 +251,10 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Divides two integers. The decimal part of the result is discarded (truncated).
Divides the two [int]s. The result is an [int]. This will truncate the [float], discarding anything after the floating point.
[codeblock]
print(10 / 2) # 5
print(10 / 3) # 3
print(6 / 2) # Prints 3
print(5 / 3) # Prints 1
[/codeblock]
</description>
</operator>
@@ -265,24 +262,24 @@
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if this [int] is less than the given [float].
Returns [code]true[/code] if the [int] is less than the [float].
</description>
</operator>
<operator name="operator &lt;">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the left integer is less than the right one.
Returns [code]true[/code] if the left [int] is less than the right [int].
</description>
</operator>
<operator name="operator &lt;&lt;">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Performs bitwise shift left operation on the integer. Effectively the same as multiplying by a power of 2.
Performs the bitwise shift left operation. Effectively the same as multiplying by a power of 2.
[codeblock]
print(10 &lt;&lt; 1) # 20
print(10 &lt;&lt; 4) # 160
print(0b1010 &lt;&lt; 1) # Prints 20 (binary 10100)
print(0b1010 &lt;&lt; 3) # Prints 80 (binary 1010000)
[/codeblock]
</description>
</operator>
@@ -290,66 +287,66 @@
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if this [int] is less than or equal to the given [float].
Returns [code]true[/code] if the [int] is less than or equal to the [float].
</description>
</operator>
<operator name="operator &lt;=">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the left integer is less than or equal to the right one.
Returns [code]true[/code] if the left [int] is less than or equal to the right [int].
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if the integer is equal to the given [float].
Returns [code]true[/code] if the [int] is equal to the [float].
</description>
</operator>
<operator name="operator ==">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if both integers are equal.
Returns [code]true[/code] if the two [int]s are equal.
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if this [int] is greater than the given [float].
Returns [code]true[/code] if the [int] is greater than the [float].
</description>
</operator>
<operator name="operator &gt;">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the left integer is greater than the right one.
Returns [code]true[/code] if the left [int] is greater than the right [int].
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
<param index="0" name="right" type="float" />
<description>
Returns [code]true[/code] if this [int] is greater than or equal to the given [float].
Returns [code]true[/code] if the [int] is greater than or equal to the [float].
</description>
</operator>
<operator name="operator &gt;=">
<return type="bool" />
<param index="0" name="right" type="int" />
<description>
Returns [code]true[/code] if the left integer is greater than or equal to the right one.
Returns [code]true[/code] if the left [int] is greater than or equal to the right [int].
</description>
</operator>
<operator name="operator &gt;&gt;">
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Performs bitwise shift right operation on the integer. Effectively the same as dividing by a power of 2.
Performs the bitwise shift right operation. Effectively the same as dividing by a power of 2.
[codeblock]
print(10 &gt;&gt; 1) # 5
print(10 &gt;&gt; 2) # 2
print(0b1010 &gt;&gt; 1) # Prints 5 (binary 101)
print(0b1010 &gt;&gt; 2) # Prints 2 (binary 10)
[/codeblock]
</description>
</operator>
@@ -357,10 +354,9 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Returns the result of bitwise [code]XOR[/code] operation for two integers.
Performs the bitwise [code]XOR[/code] operation.
[codeblock]
print(5 ^ 1) # 4
print(4 ^ 7) # 3
print(0b1100 ^ 0b1010) # Prints 6 (binary 110)
[/codeblock]
</description>
</operator>
@@ -380,27 +376,24 @@
<return type="int" />
<param index="0" name="right" type="int" />
<description>
Returns the result of bitwise [code]OR[/code] operation for two integers.
Performs the bitwise [code]OR[/code] operation.
[codeblock]
print(2 | 4) # 6
print(1 | 3) # 3
print(0b1100 | 0b1010) # Prints 14 (binary 1110)
[/codeblock]
It's useful to store binary flags in a variable.
This is useful for storing binary flags in a variable.
[codeblock]
var flags = 0
# Turn first and third bit on.
flags |= 1
flags |= 4
flags |= 0b101 # Turn the first and third bits on.
[/codeblock]
</description>
</operator>
<operator name="operator ~">
<return type="int" />
<description>
Returns the result of bitwise [code]NOT[/code] operation for the integer. It's effectively equal to [code]-int + 1[/code].
Performs the bitwise [code]NOT[/code] operation on the [int]. Due to [url=https://en.wikipedia.org/wiki/Two%27s_complement/]2's complement[/url], it's effectively equal to [code]-(int + 1)[/code].
[codeblock]
print(~4) # -3
print(~7) # -6
print(~4) # Prints -5
print(~(-7)) # Prints 6
[/codeblock]
</description>
</operator>

View File

@@ -44,12 +44,16 @@
# Fernando Sacó <saco.fernando@gmail.com>, 2023.
# Damien Monasterios <monasterio13septiembre@gmail.com>, 2023.
# andres gallegos <andresgg.prog@gmail.com>, 2023.
# Dariem Lázaro García López <dariemgl@gmail.com>, 2023.
# Adrian Migueles <adrianmigueles14@gmail.com>, 2023.
# Joinner Medina <devjoi2018@gmail.com>, 2023.
# Denis Anfruns <daanfruns@gmail.com>, 2023.
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine class reference\n"
"Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n"
"PO-Revision-Date: 2023-02-18 04:11+0000\n"
"Last-Translator: andres gallegos <andresgg.prog@gmail.com>\n"
"PO-Revision-Date: 2023-03-26 03:46+0000\n"
"Last-Translator: Denis Anfruns <daanfruns@gmail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/"
"godot-class-reference/es/>\n"
"Language: es\n"
@@ -57,7 +61,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.16-dev\n"
"X-Generator: Weblate 4.17-dev\n"
msgid "Description"
msgstr "Descripción"
@@ -164,9 +168,66 @@ msgstr ""
msgid "Built-in GDScript functions."
msgstr "Funciones GDScript integradas."
msgid ""
"A list of GDScript-specific utility functions and annotations accessible "
"from any script.\n"
"For the list of the global functions and constants see [@GlobalScope]."
msgstr ""
"Una lista de funciones de utilidad y anotaciones específicas de GDScript "
"accesibles desde cualquier script.\n"
"Para la lista de funciones globales y constantes ver [@GlobalScope]."
msgid "GDScript exports"
msgstr "Exportaciones de Scripts GD"
msgid ""
"Asserts that the [param condition] is [code]true[/code]. If the [param "
"condition] is [code]false[/code], an error is generated. When running from "
"the editor, the running project will also be paused until you resume it. "
"This can be used as a stronger form of [method @GlobalScope.push_error] for "
"reporting errors to project developers or add-on users.\n"
"An optional [param message] can be shown in addition to the generic "
"\"Assertion failed\" message. You can use this to provide additional details "
"about why the assertion failed.\n"
"[b]Warning:[/b] For performance reasons, the code inside [method assert] is "
"only executed in debug builds or when running the project from the editor. "
"Don't include code that has side effects in an [method assert] call. "
"Otherwise, the project will behave differently when exported in release "
"mode.\n"
"[codeblock]\n"
"# Imagine we always want speed to be between 0 and 20.\n"
"var speed = -10\n"
"assert(speed < 20) # True, the program will continue.\n"
"assert(speed >= 0) # False, the program will stop.\n"
"assert(speed >= 0 and speed < 20) # You can also combine the two conditional "
"statements in one check.\n"
"assert(speed < 20, \"the speed limit is 20\") # Show a message.\n"
"[/codeblock]"
msgstr ""
"Afirma que la [condición param] es [code]true[/code]. Si la [condición "
"param] es [code]false[/code], se genera un error. Cuando se ejecuta desde el "
"editor, el proyecto en ejecución también se pausará hasta que lo reanude. "
"Esto se puede utilizar como una forma más fuerte de [method @GlobalScope."
"push_error] para informar de errores a los desarrolladores del proyecto o a "
"los usuarios del complemento.\n"
"Se puede mostrar un [param message] opcional además del mensaje genérico "
"\"Assertion failed\". Puede utilizarlo para proporcionar detalles "
"adicionales sobre por qué falló la aserción.\n"
"[b]Advertencia:[/b] Por razones de rendimiento, el código dentro de [method "
"assert] sólo se ejecuta en construcciones de depuración o cuando se ejecuta "
"el proyecto desde el editor. No incluya código que tenga efectos secundarios "
"en una llamada a [method assert]. De lo contrario, el proyecto se comportará "
"de forma diferente cuando se exporte en modo release.\n"
"[codeblock]\n"
"# Imagina que siempre queremos que la velocidad esté entre 0 y 20.\n"
"var speed = -10\n"
"assert(speed < 20) # Verdadero, el programa continuará.\n"
"assert(speed >= 0) # Falso, el programa se detendrá.\n"
"assert(speed >= 0 and speed < 20) # También puedes combinar las dos "
"sentencias condicionales en una sola comprobación.\n"
"assert(speed < 20, \"el límite de velocidad es 20\") # Muestra un mensaje.\n"
"[/codeblock]"
msgid ""
"Returns a single character (as a [String]) of the given Unicode code point "
"(which is compatible with ASCII code).\n"
@@ -184,6 +245,86 @@ msgstr ""
"a = char(8364) # a es \"€\"\n"
"[/codeblock]"
msgid ""
"Converts [param what] to [param type] in the best way possible. The [param "
"type] uses the [enum Variant.Type] values.\n"
"[codeblock]\n"
"var a = [4, 2.5, 1.2]\n"
"print(a is Array) # Prints true\n"
"\n"
"var b = convert(a, TYPE_PACKED_BYTE_ARRAY)\n"
"print(b) # Prints [4, 2, 1]\n"
"print(b is Array) # Prints false\n"
"[/codeblock]"
msgstr ""
"Convierte [param what] a [param type] de la mejor forma posible. El [param "
"type] usa los valores [enum Variant.Type].\n"
"[codeblock]\n"
"var a = [4, 2.5, 1.2]\n"
"print(a is Array) # Prints true\n"
"\n"
"var b = convert(a, TYPE_PACKED_BYTE_ARRAY)\n"
"print(b) # Prints [4, 2, 1]\n"
"print(b is Array) # Prints false\n"
"[/codeblock]"
msgid ""
"Converts a [param dictionary] (created with [method inst_to_dict]) back to "
"an Object instance. Can be useful for deserializing."
msgstr ""
"Convierte un [param dictionary] (creado con [method inst_to_dict]) en una "
"instancia de objeto. Puede ser útil para deserializar datos."
msgid ""
"Returns an array of dictionaries representing the current call stack. See "
"also [method print_stack].\n"
"[codeblock]\n"
"func _ready():\n"
" foo()\n"
"\n"
"func foo():\n"
" bar()\n"
"\n"
"func bar():\n"
" print(get_stack())\n"
"[/codeblock]\n"
"Starting from [code]_ready()[/code], [code]bar()[/code] would print:\n"
"[codeblock]\n"
"[{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, "
"source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}]\n"
"[/codeblock]\n"
"[b]Note:[/b] This function only works if the running instance is connected "
"to a debugging server (i.e. an editor instance). [method get_stack] will not "
"work in projects exported in release mode, or in projects exported in debug "
"mode if not connected to a debugging server.\n"
"[b]Note:[/b] Calling this function from a [Thread] is not supported. Doing "
"so will return an empty array."
msgstr ""
"Devuelve un array de diccionarios que representan la pila de llamadas "
"actual. Véase también [method print_stack].\n"
"[codeblock]\n"
"func _ready():\n"
" foo()\n"
"\n"
"func foo():\n"
" bar()\n"
"\n"
"func bar():\n"
" print(get_stack())\n"
"[/codeblock]\n"
"Empezando desde [code]_ready()[/code],[code]bar()[/code] esto imprimirá:\n"
"[codeblock]\n"
"[{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, "
"source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}]\n"
"[/codeblock]\n"
"[b]Nota:[/b] Esta función sólo funciona si la instancia en ejecución está "
"conectada a un servidor de depuración (i.e. una instancia de editor). "
"[method get_stack] no funcionará en proyectos exportados en modo release, o "
"en proyectos exportados en modo depuración si no se está conectado a un "
"servidor de depuración.\n"
"[b]Nota:[/b] La llamada a esta función desde un [Thread] no está soportada. "
"Si lo hace, devolverá un array vacío."
msgid ""
"Returns an array with the given range. [method range] can be called in three "
"ways:\n"
@@ -4704,19 +4845,6 @@ msgstr ""
"Las capas de renderización en las que este [CanvasItem] responde a los nodos "
"[Light2D]."
msgid "The material applied to textures on this [CanvasItem]."
msgstr "El material aplicado a las texturas en este [CanvasItem]."
msgid "The color applied to textures on this [CanvasItem]."
msgstr "El color aplicado a las texturas en este [CanvasItem]."
msgid ""
"The color applied to textures on this [CanvasItem]. This is not inherited by "
"children [CanvasItem]s."
msgstr ""
"El color aplicado a las texturas en este [CanvasItem]. Esto no es heredado "
"por los hijos de [CanvasItem]."
msgid "If [code]true[/code], the object draws behind its parent."
msgstr "Si [code]true[/code], el objeto se dibuja detrás de su padre."
@@ -5185,9 +5313,6 @@ msgstr "Establece la [Transform2D] del propietario de la forma dada."
msgid "Base node for collision objects."
msgstr "Nodo base para objetos de colisión."
msgid "Defines a 2D collision polygon."
msgstr "Define un polígono de colisión en 2D."
msgid "Collision build mode. Use one of the [enum BuildMode] constants."
msgstr ""
"Modo de construcción de colisión. Use una de las constantes de [enum "
@@ -5205,37 +5330,9 @@ msgstr ""
"altos harán la forma más gruesa, y funcionará mejor para los colisionadores "
"que entran en el polígono a alta velocidad."
msgid "Collisions will include the polygon and its contained area."
msgstr "Las colisiones incluirán el polígono y su área de contención."
msgid "Collisions will only include the polygon edges."
msgstr "Las colisiones sólo incluirán los bordes del polígono."
msgid ""
"Length that the resulting collision extends in either direction "
"perpendicular to its polygon."
msgstr ""
"Longitud que la colisión resultante se extiende en cualquier dirección "
"perpendicular a su polígono."
msgid "If [code]true[/code], no collision will be produced."
msgstr "Si [code]true[/code], no se producirá ninguna colisión."
msgid ""
"Array of vertices which define the polygon.\n"
"[b]Note:[/b] The returned value is a copy of the original. Methods which "
"mutate the size or properties of the return value will not impact the "
"original polygon. To change properties of the polygon, assign it to a "
"temporary variable and make changes before reassigning the [code]polygon[/"
"code] member."
msgstr ""
"Conjunto de vértices que definen el polígono.\n"
"[b]Nota:[/b] El valor devuelto es una copia del original. Los métodos que "
"mutan el tamaño o las propiedades del valor de retorno no afectarán al "
"polígono original. Para cambiar las propiedades del polígono, asígnalo a una "
"variable temporal y haz los cambios antes de reasignar el miembro "
"[code]polygon[/code]."
msgid "Node that represents collision shape data in 2D space."
msgstr ""
"Nodo que representa los datos de la forma de colisión en el espacio 2D."
@@ -5829,17 +5926,11 @@ msgstr "[StyleBox] que se utiliza cuando se pulsa el [ColorPickerButton]."
msgid "Colored rectangle."
msgstr "Rectángulo coloreado."
msgid ""
"The array of points that make up the [ConcavePolygonShape2D]'s line segments."
msgstr ""
"El array de puntos que forman los segmentos de línea de un "
"[ConcavePolygonShape2D]."
msgid "Returns the value of the specified parameter."
msgstr "Devuelve el valor del parámetro especificado."
msgid "Returns the faces (an array of triangles)."
msgstr "Devuelve las caras (un array de triángulos)."
msgid "Sets the faces (an array of triangles)."
msgstr "Establece las caras (un array de triángulos)."
msgid "Sets the value of the specified parameter."
msgstr "Establece el valor del parámetro especificado."
msgid ""
"The speed with which the swing or twist will take place.\n"
@@ -9627,15 +9718,9 @@ msgstr ""
msgid "Returns the value of the specified flag."
msgstr "Devuelve el valor de la flag especificada."
msgid "Returns the value of the specified parameter."
msgstr "Devuelve el valor del parámetro especificado."
msgid "If [code]true[/code], enables the specified flag."
msgstr "Si [code]true[/code], activa la flag especificada."
msgid "Sets the value of the specified parameter."
msgstr "Establece el valor del parámetro especificado."
msgid ""
"The speed with which the rotation across the axis perpendicular to the hinge "
"gets corrected."
@@ -11677,16 +11762,6 @@ msgstr ""
msgid "Placeholder for the root [Node] of a [PackedScene]."
msgstr "Marcador de posición para la raíz [Node] de una [PackedScene]."
msgid "Integer built-in type."
msgstr "Tipo entero interno."
msgid ""
"Cast a [bool] value to an integer value, [code]int(true)[/code] will be "
"equals to 1 and [code]int(false)[/code] will be equals to 0."
msgstr ""
"Transforma un valor [bool] a un valor entero, [code]int(true)[/code] será "
"igual a 1 y [code]int(false)[/code] será igual a 0."
msgid "Internet protocol (IP) support functions such as DNS resolution."
msgstr ""
"Funciones de soporte del protocolo de Internet (IP) como la resolución del "
@@ -15209,27 +15284,6 @@ msgstr "Asigna el área a una o varias capas de la física."
msgid "Sets which physics layers the area will monitor."
msgstr "Establece qué capas de la física monitoreará el área."
msgid ""
"Sets the function to call when any body/area enters or exits the area. This "
"callback will be called for any object interacting with the area, and takes "
"five parameters:\n"
"1: [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED], depending on "
"whether the object entered or exited the area.\n"
"2: [RID] of the object that entered/exited the area.\n"
"3: Instance ID of the object that entered/exited the area.\n"
"4: The shape index of the object that entered/exited the area.\n"
"5: The shape index of the area where the object entered/exited."
msgstr ""
"Establece la función de llamar cuando cualquier cuerpo/área entra o sale del "
"área. Esta llamada será llamada para cualquier objeto que interactúe con el "
"área, y toma cinco parámetros:\n"
"1: [constant AREA_BODY_ADDED] o [constant AREA_BODY_REMOVED], dependiendo de "
"si el objeto entró o salió del área.\n"
"2: [RID] del objeto que entró/salió del área.\n"
"3: ID del objeto que entró/salió del área.\n"
"4: El índice de forma del objeto que entró/salió del área.\n"
"5: El índice de forma del área donde el objeto entró/salió del área."
msgid ""
"Sets the value for an area parameter. A list of available parameters is on "
"the [enum AreaParameter] constants."
@@ -20717,15 +20771,6 @@ msgstr ""
"transformación se compone de rotación y traslación (sin escalamiento, "
"utilice [method affine_inverse] para las transformadas con escalamiento)."
msgid ""
"Returns [code]true[/code] if this transform and [code]transform[/code] are "
"approximately equal, by calling [code]is_equal_approx[/code] on each "
"component."
msgstr ""
"Devuelve [code]true[/code] si esta transformada y [code]transform[/code] son "
"aproximadamente iguales, llamando a [code]is_equal_approx[/code] en cada "
"componente."
msgid ""
"Returns the transform with the basis orthogonal (90 degrees), and normalized "
"axis vectors (scale of 1 or -1)."
@@ -21478,11 +21523,6 @@ msgstr ""
"acepte cualquier nueva conexión pendiente (por ejemplo, cuando todos tus "
"jugadores se han conectado)."
msgid "Helper to manage undo/redo operations in the editor or custom tools."
msgstr ""
"Ayudante para gestionar las operaciones de deshacer/rehacer en el editor o "
"las herramientas personalizadas."
msgid ""
"Gets the version. Every time a new action is committed, the [UndoRedo]'s "
"version number is increased automatically.\n"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -396,6 +396,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
Item *ci = p_item_list;
Item *canvas_group_owner = nullptr;
bool skip_item = false;
state.last_item_index = 0;
@@ -464,6 +465,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
Rect2i group_rect = ci->canvas_group_owner->global_rect_cache;
texture_storage->render_target_copy_to_back_buffer(p_to_render_target, group_rect, false);
if (ci->canvas_group_owner->canvas_group->mode == RS::CANVAS_GROUP_MODE_CLIP_AND_DRAW) {
ci->canvas_group_owner->use_canvas_group = false;
items[item_count++] = ci->canvas_group_owner;
}
} else if (!backbuffer_cleared) {
@@ -478,9 +480,8 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
ci->canvas_group_owner = nullptr; //must be cleared
}
if (!backbuffer_cleared && canvas_group_owner == nullptr && ci->canvas_group != nullptr && !backbuffer_copy) {
texture_storage->render_target_clear_back_buffer(p_to_render_target, Rect2i(), Color(0, 0, 0, 0));
backbuffer_cleared = true;
if (canvas_group_owner == nullptr && ci->canvas_group != nullptr && ci->canvas_group->mode != RS::CANVAS_GROUP_MODE_CLIP_AND_DRAW) {
skip_item = true;
}
if (ci == canvas_group_owner) {
@@ -498,6 +499,11 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
canvas_group_owner = nullptr;
// Backbuffer is dirty now and needs to be re-cleared if another CanvasGroup needs it.
backbuffer_cleared = false;
// Tell the renderer to paint this as a canvas group
ci->use_canvas_group = true;
} else {
ci->use_canvas_group = false;
}
if (backbuffer_copy) {
@@ -513,9 +519,9 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
texture_storage->render_target_copy_to_back_buffer(p_to_render_target, back_buffer_rect, backbuffer_gen_mipmaps);
backbuffer_copy = false;
backbuffer_gen_mipmaps = false;
material_screen_texture_cached = true; // After a backbuffer copy, screen texture makes no further copies.
material_screen_texture_mipmaps_cached = backbuffer_gen_mipmaps;
backbuffer_gen_mipmaps = false;
}
if (backbuffer_gen_mipmaps) {
@@ -526,14 +532,18 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
}
// just add all items for now
items[item_count++] = ci;
if (skip_item) {
skip_item = false;
} else {
items[item_count++] = ci;
}
if (!ci->next || item_count == MAX_RENDER_ITEMS - 1) {
if (update_skeletons) {
mesh_storage->update_mesh_instances();
update_skeletons = false;
}
_render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used);
_render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, canvas_group_owner != nullptr);
//then reset
item_count = 0;
}
@@ -586,11 +596,9 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou
}
RID material = ci->material_owner == nullptr ? ci->material : ci->material_owner->material;
if (ci->canvas_group != nullptr) {
if (ci->use_canvas_group) {
if (ci->canvas_group->mode == RS::CANVAS_GROUP_MODE_CLIP_AND_DRAW) {
if (!p_to_backbuffer) {
material = default_clip_children_material;
}
material = default_clip_children_material;
} else {
if (material.is_null()) {
if (ci->canvas_group->mode == RS::CANVAS_GROUP_MODE_CLIP_ONLY) {

Some files were not shown because too many files have changed in this diff Show More