-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to containers. #7049
Comments
It's hard to understand your point based on the above, could you provide an example project? The scale of children is affected by that of their parent, but they can of course also be scaled individually.
|
I think the issue here is that a Control does not respect its scale if it's inside a container. |
First of all thank you for your report and sorry for the delay. We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to. We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors. Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed. Thanks in advance. Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it. |
Reproduced on: OS Ubuntu 16.04.4 LTS x86_64, Godot 3.0.2 stable and master 3.1 6c2d362:
Buttons scale expected (0.5,0.5), but got (1,1) |
Removing this line fixes the problem. But maybe devs did this intentionally for something? If not, please fix this issue. Line 131 in f1970e1
|
The line above looks like it could be removed too. Line 130 in f1970e1
|
Just removing the lines is not a good idea, because for example the GridContainer does not completely use the new scale. Old:
4x O are one object. If you remove the lines and use then a
Expection would be something like this:
|
Yes, margins are still calculated as nodes are still 1/1 scale. I did some experiments, changed size calculation in grid_container.cpp and container.cpp to make it regard node's scale. It seems to work. Can be done to the other containers. |
oh wow, I forgot about this thread since no one responded and containers were all still broken in 3.x series so I thought it was just a thing. This means I never used containers since they are basically useless nodes. @alperencaliskan any idea when you might push the update for commit? |
Containers are useful for aligning and distributing nodes in a frame but a bit hard to get used to it. @vonflyhighace2 I tested on grid container only. Need to change and test other containers. I will look into others in a few days. If i can do it, i will let you know. |
As a workaround, you can wait for one frame or change the scale in func _ready():
yield(get_tree(), "idle_frame")
$HBoxContainer/Button.rect_scale = Vector2(2, 2) |
Would it be a good idea to trigger |
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
Operating system or device - Godot version:
Any. Godot 2.1 stable
Issue description (what happened, and what was expected):
child nodes take on the parent containers Scale property so scaling the child node will only be overridden by the parent. creating a scalable UI is next to impossible since the child only respects the parents scale and not there own. This could be a bug but if not I would suggest having more flexibility. The ItemList node is a perfect example, why not have the grid container have similar functionality?
Steps to reproduce:
Backstory time. Needed to create a dynamic grid of buttons, so started with a boxContainer. Ran into limitations really fast with that. Tried using a grid but ran into the scaling problem. Can't use a ItemList because it only accepts Textures. Only option would be to write a custom container, not the best route for new Users. Glad I'm not a new user but ya.
Link to minimal example project (optional but very welcome):
The text was updated successfully, but these errors were encountered: