https://github.com/kuritaro1122/pyxelbuttonmanager
https://github.com/kuritaro1122/pyxelbuttonmanager
pyxel
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kuritaro1122/pyxelbuttonmanager
- Owner: kuritaro1122
- Created: 2022-01-21T09:43:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-22T03:28:46.000Z (over 3 years ago)
- Last Synced: 2025-01-07T22:51:47.163Z (9 months ago)
- Topics: pyxel
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyxelButtonManager
## Example
```
import PyxelButton as pb
class APP:
def __init__(self):
pyxel.init(...)
pyxel.mouse(True)
def function_a():
print("Pushed Button_A")
button_a : pb.BaseButton = pb.TextButton(x=0,y=0,s="Button_A",col=pyxel.COLOR_BLACK,func=lambda:function_a())
def function_b():
print("Pushed Button_B")
button_b : pb.BaseButton = pb.TextButton(x=0,y=10,s="Button_B",col=pyxel.COLOR_BLACK,func=lambda:function_b())
self.buttonManager = pb.ButtonManager(buttons=[[button_a,lambda:TRUE,[pyxel.SPACE], [button_b,lambda:TRUE,[]]]])
pyxel.run(self.update, self.draw)
def update(self):
...
self.buttonManager.update()
def draw(self):
...
self.buttonManager.draw()
APP()
```