jsuarez/extra/embyr_deprecated/embyr/embyr.py [20:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')

#Wrapper for all Embyr programs
#Mandatory, required by kivy
class Application(kv.app.App):
   def __init__(self, size):
      super().__init__()
      pygame.init()
      self.size = size
      self.W, self.H = size
      Window.size = (self.W//2, self.H//2)
      self.scale = 1.5

   #Run a thunk forever
   def loop(self, func, interval=0):
      Clock.schedule_interval(func, interval)

   #Run a thunk once 
   def once(self, func, delay=0):
      Clock.schedule_once(func, delay)

#Wrapper for all draw canvas objects. 
#Provides a seamless interface between
#pygame surfaces and kivy graphics using
#a fast flip() buffer transfer
#Expected top performance on a laptop:
#~60fps at 1080p or ~24fps at 4k
#key: alpha mask color
#border: size of frame around canvas
class Container(kv.uix.widget.Widget):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



jsuarez/extra/embyr_deprecated/embyr2d/embyr.py [20:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Config.set('input', 'mouse', 'mouse,multitouch_on_demand')

#Wrapper for all Embyr programs
#Mandatory, required by kivy
class Application(kv.app.App):
   def __init__(self, size):
      super().__init__()
      pygame.init()
      self.size = size
      self.W, self.H = size
      Window.size = (self.W//2, self.H//2)
      self.scale = 1.5

   #Run a thunk forever
   def loop(self, func, interval=0):
      Clock.schedule_interval(func, interval)

   #Run a thunk once 
   def once(self, func, delay=0):
      Clock.schedule_once(func, delay)

#Wrapper for all draw canvas objects. 
#Provides a seamless interface between
#pygame surfaces and kivy graphics using
#a fast flip() buffer transfer
#Expected top performance on a laptop:
#~60fps at 1080p or ~24fps at 4k
#key: alpha mask color
#border: size of frame around canvas
class Container(kv.uix.widget.Widget):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



