Replies: 5 comments 12 replies
-
When using |
Beta Was this translation helpful? Give feedback.
-
This would be handy for some of the official demos (so they don't need a dummy Camera2D node), but this needs to be done in a way that doesn't break compatibility. This means we can't change how the 2D coordinate system works. |
Beta Was this translation helpful? Give feedback.
-
For "prefab" / scene objects to instantiate in other scenes, there is this discussion: Related to Add ability to center editor camera on scenes when running current scene Suggestion solutions are more editor-focused than release-focused, though. |
Beta Was this translation helpful? Give feedback.
-
Would love to see a solution for this as well. Having my canvas layer elements (HUD, UI, etc) misaligned in the editor is a nightmare and leads to a very inefficient trial-and-error design approach. |
Beta Was this translation helpful? Give feedback.
-
This could be a per-scene metadata. And it would also help the editor generate better scene thumbnails. |
Beta Was this translation helpful? Give feedback.
-
Having the 2D (0, 0) origin align to the viewport/screen center would be much better for game development than the current way that aligns at the top left, specially for 2D games, but also in general.
Please add at least a project setting letting us make all scenes use this logic. I'd even go as far as making it default in new projects (but obviously keeping the option if you need the current behavior).
You cut put it at
display/window/world/2d_origin_alignment
=center
|top_left
.Reasoning
The screen center is always special in both Node2D and Control, all designs will consider it in one way or another.
But screen top-left is NOT particularly special in most usages of Node2D, and in Control you can easily use anchors to deal with the screen corners as you should: independently of resolution and aspect ratio.
Thus an option for screen center origin alignment would greatly facilitate working independently of screen factor. It would specially help in 2D scenes with only central (or no) screen movement, but also in cases like top-down games where you start at (0, 0). I'd go as far as saying even 2D aspects of 3D games would benefit from this.
It also makes much more sense in the editor for "prefab" scenes, i.e. a 2D object to be instantiated. If (0, 0) is at center, the "show viewport" feature is useful to have a size comparison between the object and the screen, as the object will be at the center.
It would be easier to work with Control and Node2D interchangeably.
Most designs are based around the center of the screen (or of parent node), with corners treated specially.
It would also help a lot with any designs that deal with any sort of symmetry.
Lastly there's also the minor reason of floating-point values being more accurate near the origin, so favoring designs that put world's center around (0, 0) should have this additional little stability benefit.
Beta Was this translation helpful? Give feedback.
All reactions