Exemplo n.º 1
0
  def __init__(self, driver, **kwargs) :
    AetherModule.__init__(self, driver, **kwargs)
    self.show_params = False

    #These need to be updated as they were moved from the top
    from ocempgui.widgets import Window,Button
    from ocempgui.widgets.Constants import SIG_CLICKED

    # parameter window stuff
    self.offscreen = pygame.Surface(self.dims)
    self.re = Renderer()
    self.re.screen = driver.screen
    self.param_window = Window('Parameters')
    self.param_window.opacity = 0

    def calib_f():
      driver.input.calibrate()

    calib = Button('Calibrate')
    calib.connect_signal(SIG_CLICKED,calib_f)
    button = Button('Close')
    button.connect_signal(SIG_CLICKED,self.toggle_params)

    # add custom widgets
    widgets = self.get_parameter_widgets()

    if driver.debug :
      from aether.core import Transform

      def change_sim_shape(btn) :
        btn.set_active(True)
        if self.person.active : shape = Transform.PERSON
        elif self.poly.active : shape = Transform.POLY
        else : shape = Transform.CIRCLE
        driver.input.sim_shadow_shape = shape

      self.circle = RadioButton("Circle")
      self.circle.active = True # circle is the default
      self.person = RadioButton("Person",self.circle)
      self.poly = RadioButton("Polygon",self.circle)

      self.circle.connect_signal(SIG_CLICKED,change_sim_shape,self.circle)
      self.person.connect_signal(SIG_CLICKED,change_sim_shape,self.person)
      self.poly.connect_signal(SIG_CLICKED,change_sim_shape,self.poly)
      widgets.append(self.circle)
      widgets.append(self.person)
      widgets.append(self.poly)

    else :
      widgets.append(calib)

    widgets.append(button)
    t = Table(len(widgets),1)
    for i,w in enumerate(widgets) :
      t.add_child(i,0,w)

    self.param_window.child = t
    self.re.add_widget(self.param_window)
Exemplo n.º 2
0
	def __init__(self,*args) :
		# need to call parent class' init method explicitly in python
		AetherModule.__init__(self,*args)
		self.font = pygame.font.Font(None,24)
		self.frame = pygame.image.load("frames.png")
		self.frame_coords = ((82,94),(334,94),(454,94),(454,260),(334,260))
		self.frame_scales = ((229,302),(98,136),(98,136),(100,136),(100,136))

		self.frame_sprites = []
		self.frame_sprites.append(FaceSprite(pygame.Rect((0,0),(0,0)),lag=10))

		self.sprite_tracker = FaceSpriteTracker(max_sprites=5,tolerance=(100,100))
Exemplo n.º 3
0
	def __init__(self,driver,*args) :
		# need to call parent class' init method explicitly in python
		AetherModule.__init__(self,driver,*args)
		self.blink_phase = 0
		#self.pointer_sprite = LaserPointerSprite()

		#self.button = ButtonSprite()

		self.curr_line = []
		self.lines = [self.curr_line]

		self.lazer = LazerPointerProvider(0,(480,360))

		self.is_calibrated = False
Exemplo n.º 4
0
	def __init__(self,driver,*args) :
		# need to call parent class' init method explicitly in python
		AetherModule.__init__(self,driver,*args)

		self.world = pymunx(gravity=(0.0,0.0,0.0))

		# add the walls
		#tl, tr, bl, br = (0,0),(self.dims[0],0),(0,self.dims[1]),(self.dims[0],self.dims[1])
		#walls = ((tl,tr),(tl,bl),(tr,br),(bl,br))
		#wall_shapes = []
		#for w in walls :
		#	wall_shapes.append(self.world.add_wall(w[0],w[1],elasticity=1,friction=.5))
		#self.wall_shapes = wall_shapes

		chime_pts = ((0,0),(10,0),(10,50),(0,50))
		self.chime = self.world.add_poly(chime_pts)
		self.chime.body.position = (self.dims[0]/2,self.dims[1]/2)

		# add the circle the mouse will follow
		self.cursor_ball = self.world.add_ball(Vec2d(self.dims[0]/2,self.dims[1]/2),density=100,radius=25,elasticity=0.9,friction=0)
Exemplo n.º 5
0
	def __init__(self, driver, **kwargs) :
		#Initalize parent class
		AetherModule.__init__(self,driver,**kwargs)
Exemplo n.º 6
0
	def __init__(self, driver, color, **kwargs) :
		AetherModule.__init__(self,driver,**kwargs)
		self.driver = driver
		self.title = 'TestAetherModule'
		self.color = color
		self.letter = 'A'