summaryrefslogtreecommitdiff
path: root/scene/2d/camera_2d.cpp
AgeCommit message (Collapse)Author
2023-01-31Merge pull request #65698 from KoBeWi/cameramanRémi Verschelde
Rework how current Camera2D is determined
2023-01-30Hide clip_children for non-drawn CanvasItemsNinni Pipping
2023-01-05One Copyright Update to rule them allRémi Verschelde
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".
2022-12-06Fix for 2D viewport not updating in the editor when the camera movesRichard Adenling
This fixes a problem with 2D viewports not taking the camera position into consideration when previewed in the editor. Fixes #40441
2022-12-02Rework how current Camera2D is determinedkobewi
2022-10-18Unify usage of GLOBAL/EDITOR_GETkobewi
2022-10-11Rename Camera2D's `smoothing` to `position_smoothing`Micky
For Camera2D: `smoothing_enabled` -> `position_smoothing_enabled` `set_enable_follow_smoothing` -> `set_position_smoothing_enabled` `is_follow_smoothing_enabled` -> `is_position_smoothing_enabled` `smoothing_speed` -> `position_smoothing_speed` `set_follow_smoothing` -> `set_position_smoothing_speed` `get_follow_smoothing` -> `get_position_smoothing_speed`
2022-10-04Add rotation smoothing to Camera2DLuis Lopez
Camera2D has follow smoothing to interpolate towards a target position, but no rotation smoothing to align with the target rotation. This adds rotation smoothing directly into the Camera2D API by having two new properties: - `rotation_smoothing_enabled` - `rotation_smoothing_speed`
2022-09-21Reverse Camera2D.`rotating` to `ignore_rotation`Micky
`rotating` is misleading, as Camera2D is affected by `rotation` and `global_rotation` like any other Node2D Updates description in the docs, as well.
2022-09-06Merge pull request #64880 from Mickeon/rename-camera-positionRémi Verschelde
Rename Camera2D's `*_screen_center` and `*_position` to `get_screen_center_position` and `get_target_position`
2022-08-29Rename `CanvasItem.update()` to `queue_redraw()`Micky
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on. Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency. Just a few comments have also been changed to say "redraw". In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
2022-08-26Rename Camera2D's `screen_center` and `*_position`Micky
`get_camera_screen_center` -> `get_screen_center_position` `get_camera_position` -> `get_target_position`
2022-08-22Make `_validate_property` a multilevel methodYuri Sizov
2022-07-28Ensure changes to Camera2D's limits don't affect smoothed_camera_posMarcel Admiraal
2022-07-28When Camera2D enters tree, ensure first update is not lostMarcel Admiraal
2022-07-17Update camera position when updating camera limitMarcel Admiraal
2022-06-14Add Vector2/3 linking to more propertiesFireForge
- Camera2D.zoom - CanvasLayer.scale - ParallaxBackground.scroll_base_scale - ParallaxLayer.motion_scale - Polygon2D.texture_scale - BaseMaterial3D.uv1_scale - BaseMaterial3D.uv2_scale
2022-06-11Add suffixes to all nodes and resourcesFireForge
2022-05-05Make `{call,set,notify}_group()` immediate by defaultHugo Locurcio
This results in less surprising behavior out of the box. Internal usages were modified to keep the existing behavior identical there.
2022-03-14Merge pull request #57392 from madmiraal/implement-3888Rémi Verschelde
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-12Improve compilation speed (forward declarations/includes cleanup)Hendrik Brucker
2022-01-31Invert Camear2D zoom to make it intuitiveMarcel Admiraal
2022-01-04Rename Project Window width and height settings to match their functionMarcel Admiraal
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-17Fix condition on 'jump to limits' logicEric
This is a fix for: #54856
2021-11-16Merge pull request #54167 from ↵Rémi Verschelde
brunosxs/fix-game-crash-when-sending-a-notification-from-a-camera-class
2021-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-10-23Fixes a game crash caused by instantiating Camera2D and sending a ↵BrunoSXS
notification from it before adding it to the tree.
2021-09-21Add Get Center Method for Rect2/Rect2i and AABB.Anilforextra
2021-08-19fixed camera2d's "current" property getting reset when switching scenesThreeRhinosInAnElephantCostume
2021-08-14Use get_global_* functions instead of using transforms.Anilforextra
2021-08-13Fix some unnecessary includesAaron Franke
2021-07-27Fixed Camera2D's reset_smoothing() does not work as describedvitika9
2021-07-03add viewport.get_camera_2d()Josh Chandler
* there is now a more clear distinction between camera_2d and camera_3d functions in the engine code * simplified camera2d's exported interface - now everything happens directly with the 'current' variable and make_current and clear_current are no longer exposed- there were some situations where calling one instead of set_current would result in incomplete results * rebased to current godot master
2021-06-30Enable Camera2D smoothing on limit changeEric
2021-06-17Add PROPERTY_USAGE_NONE and use itAaron Franke
2021-05-27Tweak Camera2D editor line colors for better visibilityHugo Locurcio
The new color for screen drawing was chosen to be easier to distinguish from the 2D viewport limits. This also makes lines less opaque when the Camera2D has the Current property enabled. The increased line width is enough to spot the camera easily, and the increased opacity on top of that felt obnoxious.
2021-03-19Use real_t in non-physics 2D nodesAaron Franke
2021-03-03Hide more options of disabled propertiesMichael Alexsander
2021-03-01Make Camera2D's editor helper code only be compiled on editor buildsMichael Alexsander
2021-02-18Refactor Process Modereduz
Implements https://github.com/godotengine/godot-proposals/issues/1835#issuecomment-727186192 * PauseMode is now ProcessMode, containing the following states: ``` PROCESS_MODE_INHERIT, // same as parent node PROCESS_MODE_NORMAL, // process only if not paused PROCESS_MODE_PAUSE_ONLY, // process only if paused PROCESS_MODE_ALWAYS, // process always PROCESS_MODE_DISABLED, // never process ``` * NOTIFICATION_PAUSED and NOTIFICATION_UNPAUSED are received effectively when the node is paused and unpaused (not any longer when pause mode is set in SceneTree). * Renamed some nodes that used ProcessMode/process_mode to specify a callback type to ProcessCallback to avoid clashes.
2021-02-07Initialize class variables with default values in scene/ [1/2]Rafał Mikrut
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-28Rename Camera2D offset_h and offset_v propertiesMarcel Admiraal
2020-12-23Rename Control margin to offsetMarcel Admiraal
2020-12-16Fix camera2d zoom when set to zero (causing ERROR: affine_invert: Condition ↵Dominik 'dreamsComeTrue' Jasiński
' det == 0 ' is true.) Fixes: #41873
2020-11-22fixed Camera2D rotation with non-square zoomgreenfox
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-07-18fixed camera2D showing incorrect bounds in editorJosh Chandler