Skip to content
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

I've centering the Div for 3 hours. #667

Open
pichenka007 opened this issue Jan 15, 2025 · 0 comments
Open

I've centering the Div for 3 hours. #667

pichenka007 opened this issue Jan 15, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@pichenka007
Copy link

Is your feature request related to a problem? Please describe.
I'm confused. I couldn't find information on how I can make a “Div container from HTML” with a percentage size relative to the parent container and its indentation(except margins).

Describe the solution you'd like

  • i need a container without graphics with margins, and padding along with passing its dimensions as a percentage of the parent container's dimensions, taking into account margins, and padding.
  • add that if for example margins[“up”] == 0 then it should not be written (margins={'right': 5, 'top': 5, 'bottom': 5}) and if opposite margins are the same then it should be written for example (margins={'left': 5, 'top': 5})).
  • record relative sizes as in html for example: 50vh is 1% of the height of the parent area (same with vw) and let's say 30h is 30% of the whole height of the manger (letters are not important the main thing is the meaning).
  • add possibility to write dynamic formulas like “(10w, 10h, 50wv+70px, 20hv-20px)”.

Describe alternatives you've considered
And it would be nice to have ContainerW and ContainerH - a container with “n” number of evenly spaced containers in length inside it.

Additional context
When I made super simple interface manually without pygame gui I wrote these “fractions” myself window size * by %+ item position left/top. When I started using pygame-gui, I did all the same things.
Please tell me if there are any of the listed functions I would try to do it myself but I don't know if there is this functionality at all maybe I didn't look in the documentation properly.
Sorry for the mistakes in context, I used a translator.

@pichenka007 pichenka007 added the enhancement New feature or request label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant