Пример #1
0
    def __init__(self):
        ShowBase.__init__(self)
        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda(transparent=False)
        self.ui.load_file('ui/main.html')
Пример #2
0
    def __init__(self):
        ShowBase.__init__(self)

        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda()
        self.ui.load_url('https://frames-per-second.appspot.com/')
Пример #3
0
    def __init__(self):
        ShowBase.__init__(self)

        self.win.set_close_request_event('escape')
        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda()
        self.ui.load('ui/main.html')
Пример #4
0
    def __init__(self):
        ShowBase.__init__(self)

        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda()
        self.ui.set_js_function('update_options', self.update_options)
        self.ui.load_file('ui/main.html')
        options = json.dumps(self.get_options())
        self.ui.exec_js_func('ui_update_options', options)
Пример #5
0
    def __init__(self):
        ShowBase.__init__(self)

        self.win.set_close_request_event('escape')
        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda()
        self.ui.set_js_function('update_options', self.update_options)
        self.ui.load('ui/main.html')
        self.ui.execute_js('ui_update_options({})'.format(self.get_options()),
                           onload=True)
Пример #6
0
    def __init__(self):
        ShowBase.__init__(self)

        self.accept('escape', sys.exit)

        self.ui = cefpanda.CEFPanda()
        self.ui.set_js_function('change_color', self.change_color)
        self.ui.load_file('main.html')

        self.cube = self.loader.loadModel('box.egg.pz')
        self.cube.reparentTo(self.render)

        self.taskMgr.add(self.spin_camera_task, 'spin_camera_task')
Пример #7
0
    def get(self):
        """
    Get UI

    Gets the UI singleton and initializes it if not already done.
    """
        if WebUI.ui is None:
            WebUI.ui = cefpanda.CEFPanda(transparent=True,
                                         size=[-1.0, 1.0, -1.0, 1.0])
            Refresh.addListener(WebUI.load)
            WebUI.load()

        return WebUI.ui
Пример #8
0
    def __init__(self):
        ShowBase.__init__(self)
        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda(
            transparent=False,
            size=[-0.75, 0.75, -0.75, 0.75],
            # parent=base.aspect2d,
        )
        self.ui.node().set_scale(0.9)
        self.ui.node().set_pos(0.05, 0.0, -0.1)
        self.ui.set_js_function('call_py', self.handler_js_to_py)
        self.ui.load_file('ui/main.html')
Пример #9
0
    def __init__(self):
        ShowBase.__init__(self)

        self.accept('escape', sys.exit)

        # Setup ui
        self.ui = cefpanda.CEFPanda()

        def call_py1():
            print('Python called (func1)')

        self.ui.set_js_function('call_py1', call_py1)

        def call_py2():
            print('Python called (func2)')

        self.ui.set_js_function('call_py2', call_py2)
        self.ui.load_file('ui/main.html')