Verified Commit e95d4abf authored by Jakob Moser's avatar Jakob Moser
Browse files

Add preview_scene script

parent 451cfb8d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4,3 +4,5 @@
    - This is also what powers the display code in `poolpay/display`, however, this is the original version of the script
- `test_touch.py`
    - Use `evdev` to get touch events, prints many of them (including coordinates)
- `preview_scene.py`
    - Preview a scene using a fake PyGame display
+35 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3

from functools import cached_property

import pygame

from poolpay.director.Director import Director
from poolpay.ui.pygame.play import play


class Display:
    @cached_property
    def surface(self):
        surface = pygame.display.set_mode((480, 320))
        return surface

    def refresh(self) -> None:
        pygame.display.flip()


display = Display()

director = Director(play, display)

# director.nothing_requested()

# sleep(10)

play.Balance(
    director,
    balance_cents=-1000,
    person_name="Jakob"
).present()

input()