예제 #1
0
###  prepare stimuli  ###
#########################
# first all kind of structural messages
startexp = visual.TextStim(win,text=stim_info['startexp_text'],color=win_info['fg_color'],wrapWidth=win.size[0])
endExp = visual.TextStim(win,text=stim_info['exp_outro'],color=win_info['fg_color'],wrapWidth=win.size[0])
pause = visual.TextStim(win,text=stim_info['pause_text'],color=win_info['fg_color'],wrapWidth=win.size[0])
#feedback things   
smiley = visual.ImageStim(win,'smiley.png',contrast=-1,size=(50,50)) # good feedback
frowny = visual.ImageStim(win,'frowny.png',contrast=-1,size=(50,50)) # bad feedback
# progressbar 
progress_bar =visual.Rect(win,width=10,height=20,lineColor=win_info['fg_color'],fillColor=win_info['fg_color'],pos = [-500,-200])
progress_bar_start =visual.Rect(win,width=10,height=20,lineColor=win_info['fg_color'],fillColor=win_info['fg_color'],pos = [-500,-200])
progress_bar_end =visual.Rect(win,width=10,height=20,lineColor=win_info['fg_color'],fillColor=win_info['fg_color'],pos = [500,-200])
# Greeble and fixation dot
greeble = visual.ImageStim(win,image=image_paths[0],size=(320*stim_info['image_scale'],360*stim_info['image_scale']))
fixDot = et.fancyFixDot(win, bg_color = win_info['bg_color'],size=24) # fixation dot

# combine feedback stims to make it easier later
feedback_stims = [frowny,smiley]

###########################
###  START BLOCK LOOP # ###
###########################
# draw intro before starting block
startexp.draw()
trial_info['start_block_time']=win.flip()
if response_info['run_mode'] != 'dummy':
    while True:
        startexp.draw()
        win.flip()                        
        cont=et.captureResponse(mode=response_info['resp_mode'],keys = [pause_resp])    
예제 #2
0
파일: vbm.py 프로젝트: eort/cococode
mon.setSizePix(win_info['win_size'])
win=visual.Window(size=win_info['win_size'],color=win_info['bg_color'],fullscr=win_info['fullscr'],units="deg",autoLog=0,monitor=mon)
shift = win_info['shift']
# and text stuff
startExp = visual.TextStim(win,pos=[-shift, 0], text='Willkommen zur Casinoaufgabe!\nGleich geht es los.',color=win_info['fg_color'],height=0.6,autoLog=0)
startBlock = visual.TextStim(win,pos=[-shift, 0],text=stim_info['startBlock_text'],color=win_info['fg_color'],height=0.6,autoLog=0)
endBlock = visual.TextStim(win,pos=[-shift, 0],text=stim_info['endBlock_text'],color=win_info['fg_color'],autoLog=0,height=0.6)
endExp = visual.TextStim(win,pos=[-shift, 0],text=stim_info['endExp_text'],color=win_info['fg_color'],autoLog=0,height=0.6)
warning = visual.TextStim(win,pos=[-shift, 0],text=stim_info["warning"],color='white',autoLog=0,height=0.6)
timeout_screen = visual.TextStim(win,pos=[-shift, 0],text='Zu langsam!',color='white',height=0.6,autoLog=0)
# and stimuli
progress_bar =visual.Rect(win,height=bar['height'],width=bar['width'],lineColor=None,fillColor=et.rgb2psypy(bar['color']),pos=[-bar['horiz_dist']-shift,-bar['vert_dist']],autoLog=0)
progress_update =visual.Rect(win,height=bar['height'],width=0,lineColor=None,fillColor=et.rgb2psypy(bar['color']),autoLog=0,pos=(-bar['horiz_dist']-shift,-bar['vert_dist']))
progress_bar_start=visual.Rect(win,width=bar['width'],height=bar['height'],lineColor=None,fillColor=et.rgb2psypy(bar['color']),pos = [-bar['horiz_dist']-shift,-bar['vert_dist']],autoLog=0)
progress_bar_end =visual.Rect(win,width=bar['width'],height=bar['height'],lineColor=None,fillColor=et.rgb2psypy(bar['color']),pos = [bar['horiz_dist']-shift,-bar['vert_dist']],autoLog=0)
fixDot = et.fancyFixDot(win, bg_color = win_info['bg_color']) 
leftframe = visual.Rect(win,width=stim_info['bar_width'],height=stim_info['bar_height'],lineColor=win_info['fg_color'],fillColor=None,pos = [-stim_info['bar_x']-shift,stim_info['bar_y']],lineWidth=stim_info['line_width'],autoLog=0)
rightframe = visual.Rect(win,width=stim_info['bar_width'],height=stim_info['bar_height'],lineColor=win_info['fg_color'],fillColor=None,pos = [stim_info['bar_x']-shift,stim_info['bar_y']],lineWidth=stim_info['line_width'],autoLog=0)
leftbar = visual.Rect(win,width=stim_info['bar_width'],lineColor=None,fillColor=win_info['fg_color'],autoLog=0)
rightbar = visual.Rect(win,width=stim_info['bar_width'],lineColor=None,fillColor=win_info['fg_color'],autoLog=0)
selectbar = visual.Rect(win,width=stim_info['bar_width']*1.7,height=stim_info['bar_height']*1.7,lineColor=win_info['fg_color'],fillColor=None,lineWidth=stim_info['line_width'],autoLog=0)
leftProb = visual.TextStim(win,height=0.44,color=win_info['fg_color'],pos=[-stim_info['bar_x']-shift,-0.8*stim_info['bar_height']+stim_info['bar_y']],autoLog=0)
rightProb = visual.TextStim(win,height=0.44,color=win_info['fg_color'],pos=[stim_info['bar_x']-shift,-0.8*stim_info['bar_height']+stim_info['bar_y']],autoLog=0)

# set Mouse to be invisible
event.Mouse(win=None,visible=False)
event.clearEvents()

# reset all triggers to zero
et.sendTriggers(port,0)
예제 #3
0
파일: ml.py 프로젝트: eort/cococode
                              pos=(-bar['horiz_dist'], -bar['vert_dist']))
progress_bar_start = visual.Rect(win,
                                 width=bar['width'],
                                 height=bar['height'],
                                 lineColor=None,
                                 fillColor=bar['color'],
                                 pos=[-bar['horiz_dist'], -bar['vert_dist']],
                                 autoLog=0)
progress_bar_end = visual.Rect(win,
                               width=bar['width'],
                               height=bar['height'],
                               lineColor=None,
                               fillColor=bar['color'],
                               pos=[bar['horiz_dist'], -bar['vert_dist']],
                               autoLog=0)
fixDot = et.fancyFixDot(win, bg_color=win_info['bg_color'], size=0.4)
leftframe = visual.Rect(win,
                        width=stim_info['bar_width'],
                        height=stim_info['bar_height'],
                        fillColor=None,
                        pos=[-stim_info['bar_x'], stim_info['bar_y']],
                        lineWidth=stim_info['line_width'],
                        autoLog=0)
rightframe = visual.Rect(win,
                         width=stim_info['bar_width'],
                         height=stim_info['bar_height'],
                         fillColor=None,
                         pos=[stim_info['bar_x'], stim_info['bar_y']],
                         lineWidth=stim_info['line_width'],
                         autoLog=0)
leftbar = visual.Rect(win,