Replies: 8 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.
-
Hey, I'd like to see it implemented too. Up until now all my scenes are centered around |
Beta Was this translation helpful? Give feedback.
-
I just started learning this engine and the chaos around coordinate system is a real deal breaker for me. It's a small issue, but such a fundamental design flaw. New scenes start with 0,0 in the top left corner, and that's also how you see them when previewing individual scenes. So if you wanted an object to be in the center of the visible scene in both editor and when previewing, you need to position the objects at half the screen size in x and y. But there is no constants, no buttons, nothing to indicate that or to help with that. It just doesn't make sense to me... |
Beta Was this translation helpful? Give feedback.
-
Hi! I think I found the solution by hunting around the Game Tab interface.
I have attached some photos so you can see what I mean. This should autoshift your Scene to be fully viewable without having to destructively edit parameters. It also looks like it works PER SCENE, so it's not a global effect for everything. This is great, because there are Scenes which we DON'T want to move, like full play screens we want to see the "compiled" (end user view) version of. EDIT: Actually, nevermind, that's not what you are talking about. However, I'm just going to leave my comment here for others that might accidentally think the original problem is what I thought it was. If the devs feel it's not helpful, they are free to delete it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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 could 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. Plus you would be able to preview its behavior with F6 and see it in center without having to add a camera or into another scene.
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 very minor reason of floating-point values being more accurate near the origin, so favoring designs that put world's center around (0, 0) might have this additional little stability benefit. Maybe negligible, but I thought it's worth mentioning it.
Beta Was this translation helpful? Give feedback.
All reactions