Comments (10)
Long scrolling menus:
[USING SCROLLBAR]
-
The problem here is i don't know how to "cut" things: i draw my menu, suppose 600x1000px in total (width, height) but my canvas only supports 600x400, so somehow i need to cut only between (e,400+e)px of the height in order to properly draw things. That's easy with OPENGL clipping window, but with pygame? maybe some opengl should be used.
-
Draw a scrollbar, that's not difficult. Also that scrollbar should handle mouse input: if the user clicks between scrollbar rectangle (and holds) it should move itself and scroll the page.
[USING PAGES]
That's more easy, just create a menu with several pages, if user press any pair of keys (LEFT, RIGHT) the menu must change between page x and x+1, x in (1,n). The number of the page must be drawn somewhere (bottom right corner maybe?)
from pygame-menu.
One possible solution might be to scroll down the items and when at the bottom it loads a new page and scrolling starts again... Ideally with a little animation to show the transition. Might be tricky if scrolling up and down through that border area though.
from pygame-menu.
I'll work on this in the following weeks
from pygame-menu.
I've been trying to get pagination to work with a selector, but onchange doesn't seem to allow you to load a new menu.
from pygame-menu.
I've been trying to get pagination to work with a selector, but onchange doesn't seem to allow you to load a new menu.
Do you have any working example?
from pygame-menu.
I've been trying to get pagination to work with a selector, but onchange doesn't seem to allow you to load a new menu.
Do you have any working example?
I am trying to use it for my flatpak-manager for SteamOS. The code I was talking about can be found here: https://github.com/sharkwouter/flatpak-manager/blob/master/flatpak-manager-steamos/flatpakmanager_steamos/gui.py#L97
If you'd like to test that code, you can execute flatpak-manager/flatpak-manager-steamos/flatpak-manager-steamos script to test it. It is specific to Linux, though, and requires flatpak to be installed.
I could make a short script which shows what I'm trying to do better. Not sure it if is very clear from this code. Let me know if that is needed.
from pygame-menu.
I've been trying to get pagination to work with a selector, but onchange doesn't seem to allow you to load a new menu.
Do you have any working example?
I am trying to use it for my flatpak-manager for SteamOS. The code I was talking about can be found here: https://github.com/sharkwouter/flatpak-manager/blob/master/flatpak-manager-steamos/flatpakmanager_steamos/gui.py#L97
If you'd like to test that code, you can execute flatpak-manager/flatpak-manager-steamos/flatpak-manager-steamos script to test it. It is specific to Linux, though, and requires flatpak to be installed.
I could make a short script which shows what I'm trying to do better. Not sure it if is very clear from this code. Let me know if that is needed.
Hi, I prefer a short script to test the behaviour of the selector
from pygame-menu.
No problem, I made a simplified version with just the paged menu here: https://gist.github.com/sharkwouter/ec465d36f6f9fd1570e17511c570f36c
Don't pay too much attention to calculation which determines how many pages there are. It can be off by one with different range sizes.
from pygame-menu.
from pygame-menu.
Related issue: #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.