summaryrefslogtreecommitdiffstats
path: root/scene/2d/node_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't access Node3D/Node2D/Control global transform in `reparent` unless neededRémi Verschelde2024-02-291-2/+4
| | | | | | Fixes #89002. Co-authored-by: Tamás Gálffy <ezittgtx@gmail.com>
* Fix notification thread guardsbitsawer2023-10-021-1/+4
|
* Replace `radians` range hint with `radians_as_degrees`A Thousand Ships2023-09-251-4/+4
|
* Fix global transform validity for `Node2D` and `Control`Markus Sauermann2023-08-081-8/+0
| | | | Set global transform to invalid when changing transform
* Use NULL instead of COND checks when appropriateNinni Pipping2023-06-101-1/+1
| | | | Restricted to scene
* Optimize threading-sensitive node data for single-threaded processingPedro J. Estébanez2023-05-171-19/+31
|
* Make more base nodes thread safeJuan Linietsky2023-05-151-12/+49
| | | | Ongoing work to make more of the base nodes thread safe.
* Remove NOTIFICATION_MOVED_IN_PARENTJuan Linietsky2023-04-061-2/+7
| | | | | | | | | * This notification makes node children management very inefficient. * Replaced by a NOTIFICATION_CHILDREN_CHANGED (and children_changed signal). * Changed Canvas code (and similar) to use the above signal, to perform more efficiently. This PR breaks compatibility (although this notification was very rarely used, even within the engine), but provides an alternate way to do the same. It is required for the changes in #75627 to be entirely effective.
* Merge pull request #36301 from KoBeWi/daddy_nodeRémi Verschelde2023-01-071-0/+8
|\ | | | | | | Add reparent methods to Node
| * Add methods for node reparentingTomasz Chabora2022-08-161-0/+8
| |
* | One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* | Restore 'rotation_degrees' properties.Juan Linietsky2022-12-191-0/+22
| | | | | | | | | | | | | | | | | | By popular demand, restoring the helper properties to rotate objects in degrees. Affected are local and global rotations for: * Node2D * Node3D * Control
* | Move z_index, z_as_relative and y_sort_enabled from Node2D to CanvasItemHendrik Brucker2022-11-291-46/+0
| |
* | Fix Viewport root order after Node2D raiseMarkus Sauermann2022-11-021-0/+12
| |
* | Fix hide_slider vs no_slider inconsistency in editor property codeAaron Franke2022-10-031-1/+1
| |
* | Rename `or_lesser` range property hint to `or_less`Hugo Locurcio2022-09-021-2/+2
|/ | | | | | | "less" should be used for quantity, rather than "lesser". Existing scripts that use `or_lesser` in `_get_property_list()` will need to be updated to account for this change.
* Rename export_range's noslider option to no_sliderMarcus Elg2022-06-241-1/+1
|
* Add vector value linkingkobewi2022-06-141-1/+1
| | | | Co-authored-by: redlamp <244062+redlamp@users.noreply.github.com>
* Fix global properties and add global skew for node2dVincent D2022-05-241-15/+41
| | | | | | | | | | | | Renamed parent item variable in node2d global setters and optimize Aligned variable renaming in global setters Optimize node2d global setters Add global skew description in doc Co-Authored-By: Aaron Franke <arnfranke@yahoo.com>
* Use suffixes for units in nodes and resourcesAaron Franke2022-05-191-4/+4
|
* Rename Transform2D "elements" to "columns"Aaron Franke2022-04-291-2/+2
|
* Fix some issues found by cppcheck.bruvzg2022-04-061-8/+8
|
* Code quality cleanup for some variable scopes.Anilforextra2022-02-101-2/+1
|
* Node2D/Node3D: Fix Undraggable Position Property.Anilforextra2022-01-251-1/+1
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Node2D member renames.Anilforextra2021-09-241-37/+33
|
* Revert "Display a matrix for Node2D and don't display a duplicate origin"Juan Linietsky2021-08-291-3/+1
|
* Display a matrix for Node2D and don't display a duplicate originAaron Franke2021-08-291-1/+3
|
* Fix some unnecessary includesAaron Franke2021-08-131-5/+0
|
* Limit scale of node2D to EPSILON 0.00001 to prevent det==0 bugJestemStefan2021-07-121-2/+2
|
* Fix editor suffixes and degrees conversionreduz2021-06-301-36/+3
| | | | | | | | | | | | | * Functions to convert to/from degrees are all gone. Conversion is done by the editor. * Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees. * Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m" * In general, can add suffixes for EditorSpinSlider Not covered by this PR, will have to be addressed by future ones: * Ability to switch radians/degrees in the inspector for angle properties (if actually wanted). * Animations previously made will most likely break, need to add a way to make old ones compatible. * Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes. * Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
* Add PROPERTY_USAGE_NONE and use itAaron Franke2021-06-171-6/+6
|
* Deleted YSort, moved its functionality directly into Node2D.andriyDev2021-06-051-1/+14
| | | | | | | | | YSort now has a compatibility alias to Node2D. Updated TileMap to use the existing Node2D y_sort_enabled property instead of its own property. Updated Node2D doc to include the new y_sort_enabled member. Updated TileMap doc to remove its mention of cell_y_sort. Deleted YSort doc.
* Use real_t in non-physics 2D nodesAaron Franke2021-03-191-19/+19
|
* Removed _change_notifyreduz2021-02-101-17/+0
| | | | | | -For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Move initialization of some classes to headersTomasz Chabora2020-12-111-9/+0
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-24/+46
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-41/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Implement Skew in Node2DJuan Linietsky2020-05-011-2/+40
| | | | Skew is x-axis only, because it must be bidirectionally convertible to a 2x3 matrix, but you can subtract it to the rotation to get the effect on y-axis
* Renaming of servers for coherency.Juan Linietsky2020-03-271-8/+8
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Added a Window node, and made it the scene root.Juan Linietsky2020-03-261-1/+1
| | | | Still a lot of work to do.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-4/+4
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Control/Light2D: Preventing setting 0 as scale as for Node2DRémi Verschelde2020-01-131-0/+1
| | | | | | | Triggers errors in `Transform2D::affine_invert()`. Fixes #26510. Fixes https://github.com/godotengine/godot/issues/24997#issuecomment-457951639.
* Don't compile editor-only function when tools=noGilles Roudière2020-01-091-0/+3
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Altered rotation_degrees rangeSoumya Lahiri2019-09-301-1/+1
|
* Fix look_at with non uniform scalingPaul Trojahn2019-02-081-1/+1
| | | | | The angle function doesn't consider the scaling of the local coordinates, so it needs to be removed first. Fixes #23247