Hi all,
I have made a game (which I have posted about before) using the scene module.
I am trying to get a pyui file to launch the scene. After some trial and error I managed it like this:
import ui
from black_white import *
from time import sleep
from scene import run
@ui.in_background
def start(sender):
run(Game(), show_fps=False)
v = ui.load_view()
v.present('sheet', hide_title_bar = True)
black_white is the name of the script running my scene Game.
I could only get it to work by running the scene 'inside' the UI. I had to import time.sleep and scene.runas my script needs them, which seems quite messy. When I try to close the UI view v at the end of the start function, everything closes!
Does anyone know of a better way to do this?