check_width = check_width, color1 = check_color1, color2 = check_color2, fixation_dot_color = fixation_dot_color ) if pos_x is None: pos_x = -0.5*self.CB.board_width if pos_y is None: pos_y = -0.5*self.CB.board_width self.pos_x = pos_x self.pos_y = pos_y def render(self): Screen.render(self) #move so that board is centered and render gl.glLoadIdentity() gl.glTranslatef(self.pos_x,self.pos_y,0.0) self.CB.render() ################################################################################ # TEST CODE ################################################################################ if __name__ == "__main__": CBS = Screen.with_pygame_display(debug = True) CBS.setup(background_color = "neutral-gray", vsync_value = 1 ) CBS.run(duration = 5)
finally: gl.glEnable(gl.GL_LIGHTING) ################################################################################ # TEST CODE ################################################################################ if __name__ == "__main__": import pygame from common import DEBUG, UserEscape from screen import Screen from animated_screen import AnimatedScreen from numpy import pi pygame.init() pygame.mouse.set_visible(False) try: # setup the screen with fixation_cross FC = FixationCross(color="black") scr = Screen.with_pygame_display() scr.setup(background_color="white", fixation_cross=FC) # run the screen scr.run(duration=2) except UserEscape as exc: print(exc) pygame.quit() sys.exit()