#!/usr/bin/env python # from psychopy import * import game import pygame import avalgame import text_input from pygaze.eyetracker import EyeTracker from pygaze.libscreen import Screen, Display from pygame.display import list_modes print list_modes() pygame.init() disp = Display() clock = pygame.time.Clock() ### Definitions ###### Resolution #win_size = pygame.display.Info() #windowSize = pygame.display.set_mode((win_size.current_w, win_size.current_h), pygame.FULLSCREEN) # Change as you want (MUST RESPECT DISPLAY DIMENSIONS) windowSize = pygame.display.set_mode((1024, 768), pygame.FULLSCREEN) running = True version = "v1.00" avalgame = avalgame.Avalgame() class GameSettings(pygame.font.Font): def __init__(self, screen, display, bg_color=(0, 0, 0), font='media/fonts/arial.ttf',
withTracker = cst.TRACKER run = r.RUN DISPSIZE = (res[0],res[1]) #find interstimulus distance, based on resolution and view distance, for #4' viewing angle; since PsychoPy calculates distance on centerpoint, adding #128 (half of stimulus width) base_dist = (2 * dist * math.tan(math.radians(4)/2)) base_dist_half = base_dist / 2 pixpcm = res[0] / res[2] base_dist_pix = int(base_dist_half * pixpcm) + 128 # In[Initiate PyGaze Objects]: disp = Display(disptype='psychopy') scr = Screen(disptype='psychopy') if inScanner or withTracker: kb = Keyboard() if withTracker: tracker = EyeTracker(disp) DISPSIZE = cst.DISPSIZE fps_str = str(flicker).replace('.','_') basename = "{}_{}".format(subid, fps_str) LOGFILENAME = basename + '_eyetracker' director = os.getcwd()