| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- from .print_tree import print_tree
- from .api import *
- from .gfx import Layer
- from . import settings
- class App(EventLoop):
- def __init__(self):
- super().__init__()
- w = get_property("/window", "width")
- h = get_property("/window", "height")
- self.chatbox_layer = Layer("chatbox_layer")
- self.chatbox_layer.resize(w, h)
- self.chatbox_layer.add_obj("outline")
- def resize_event(self, w, h):
- print(f"resize ({w}, {h})")
- self.chatbox_layer.resize(w, h)
- def mouse_click(self, x, y):
- print(f"mouse click ({x}, {y})")
- def mouse_wheel(self, y):
- settings.ui_scale *= 1 + y/100
- print(settings.ui_scale)
- def key_down(self, keycode, keymods, repeat):
- #print(f"key_down: '{keycode}'")
- if keymods.ctrl and keycode == "=":
- settings.ui_scale *= 1.01
- print(settings.ui_scale)
- elif keymods.ctrl and keycode == "-":
- settings.ui_scale *= 0.99
- print(settings.ui_scale)
- def main():
- garbage_collect()
- app = App()
- print_tree()
- app.run()
|