Comments (13)
@eforgacs merged to master!
from pygame-menu.
Would definitely be a nice feature if you can get to it but this library kicks ass regardless - Great job man.
from pygame-menu.
Would definitely be a nice feature if you can get to it but this library kicks ass regardless - Great job man.
Any push request is appreciated, there's a lot of things to improve. Greetings! 😄
from pygame-menu.
#115 fixes this issue!
from pygame-menu.
i think it's possible, maybe a function named add_container(*args) that can contain any items, selectors, etc... so if container is drawn add (x,y) to all items within ...
Possible usage:
# Returns some kind of menu object instance
container_left = main_menu.add_container(x='10%',y=50,float='left',max_width='50%'....)
container_left.add_selector(....)
container_right = main_menu.add_container(x='10%',y=50,float='right',max_width='50%'....)
max_width, float, x or y padding can be optional parameters of the container object.
"left" and "right" work with selectors, when you add a list of items and the user press "LEFT" or "RIGHT" button in order to change the value
from pygame-menu.
Is this a thing? I dont see it in the readme.
from pygame-menu.
Is this a thing? I dont see it in the readme.
It has not been implemented yet 😢
from pygame-menu.
Seconding @chrisjd20 's sentiment. Would love to see this feature! (This thread is the first result on Google for 'pygame menu with columns'). I'd be happy to contribute to working on it as well. Any ideas on where to begin?
from pygame-menu.
To solve this problem I think in boxes like the grid engine in CSS.
The whole menu area can be the 100% in horizontal and vertical.
By default the menu contains an "box" with all the area. If two boxes are added (each one with 50% of the width) then the widgets belonging to each box are written based on the coordinates from the parent element, like
for each box in area:
xi, yi = box.get_relative_coords()
for each widget in box:
widget.draw(xi+widget.posx, y+widget.posy)
The widget max width should be the width of the parent element.
To solve problems in alignment, maybe all boxes are appended at the left of the parent element. So if anyone wants a right menu, something like this can be done:
container = menu.create_container(width=100%, vertical=80%)
container.add_empty(width=50%)
rightcontainer = container.add_box(width=50%)
rightcontainer.add_button(....)
rightcontainer max width should be the 50% of the menu width in px. Then add_button should pass the max width to the widgets.
Anyway this solution is not easy at all, all widgets should be refactored. Also this solution must be compatible with alignment.
from pygame-menu.
PD: Maybe something like
menu.add_widget(container=rightcontainer)
Is better and less confusing
from pygame-menu.
Awesome!!!! Thank you so much!
from pygame-menu.
@eforgacs merged to master!
Woo hoo!! This is great 😄 Thanks again for all the hard work!
from pygame-menu.
Working fine also for me.
Still a work to do for compatibility with scrolling menu: see #15
from pygame-menu.
Related Issues (20)
- Center menu items when scrollbar is shown HOT 5
- Python version limit HOT 2
- typehints (label) - mypy HOT 2
- [BUG] Menu closes for no reason HOT 5
- Resize all submenus HOT 3
- Unable to hide the cursor, due to pygame_menu HOT 3
- Controller has no influence on menu actions HOT 1
- Example of menu using USB controller, with name of controller used HOT 6
- pygame-ce requirement HOT 6
- file selector HOT 5
- How do I limit the size of a label in px? HOT 4
- Mouse-selection bug HOT 4
- Unpacking then repacking any widget misplaces it in the parent frame HOT 1
- Add method to dropselect API that tells if its dropdown is expanded
- Have a _sdl2 mode where make_surface is never called whith alpha=True
- Navigating back from a nested submenu forgets the widget selection in the parent menu HOT 2
- User warning for equal title font color and menu background color when the latter is set to (0, 0, 0) HOT 2
- How check value for text_input? HOT 1
- AttributeError when changing rangeslider value with an USB gamepad
- bug in windows HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygame-menu.