Esempio n. 1
0
scr.clear()
scr.draw_text("There should be three lines on the screen: \
\nred oblique on the left, green horizontal in the centre, and blue vertical on the right", pos=(DISPSIZE[0]/2, DISPSIZE[1]/4))
scr.draw_line(colour=(255,0,0), spos=(DISPSIZE[0]*0.20,DISPSIZE[1]*0.45), epos=(DISPSIZE[0]*0.30,DISPSIZE[1]*0.55), pw=5)
scr.draw_line(colour=(0,255,0), spos=(DISPSIZE[0]*0.45,DISPSIZE[1]/2), epos=(DISPSIZE[0]*0.55,DISPSIZE[1]/2), pw=5)
scr.draw_line(colour=(0,0,255), spos=(DISPSIZE[0]*0.75,DISPSIZE[1]*0.45), epos=(DISPSIZE[0]*0.75,DISPSIZE[1]*0.55), pw=5)
disp.fill(scr)
disp.show()
kb.get_key()

#scr.draw_polygon()
scr.clear()
scr.draw_text("There should be two polygons on the screen: \
\nred filled triangle on the left, and green unfilled hexagon on the right", pos=(DISPSIZE[0]/2, DISPSIZE[1]/4))
pl = [(DISPSIZE[0]*0.25, DISPSIZE[1]*0.45), (DISPSIZE[0]*0.2, DISPSIZE[1]*0.55), (DISPSIZE[0]*0.3, DISPSIZE[1]*0.55)]
scr.draw_polygon(pl, colour=(255,0,0), pw=5, fill=True)
# topleft, topright, centreright, bottomright, bottomleft, centreleft
pl = [(DISPSIZE[0]*0.70, DISPSIZE[1]*0.40), (DISPSIZE[0]*0.80, DISPSIZE[1]*0.40), (DISPSIZE[0]*0.85, DISPSIZE[1]*0.5), (DISPSIZE[0]*0.80, DISPSIZE[1]*0.60), (DISPSIZE[0]*0.70, DISPSIZE[1]*0.60), (DISPSIZE[0]*0.65, DISPSIZE[1]*0.5)]
scr.draw_polygon(pl, colour=(0,255,0), pw=5, fill=False)
disp.fill(scr)
disp.show()
kb.get_key()

#scr.draw_fixation()
scr.clear()
scr.draw_text("There should be three fixation targets on the screen: \
\nred cross on the left, green X in the centre, and blue dot on the right", pos=(DISPSIZE[0]/2, DISPSIZE[1]/4))
scr.draw_fixation(fixtype='cross', colour=(255,0,0), pos=(DISPSIZE[0]*0.25,DISPSIZE[1]/2), pw=3, diameter=15)
scr.draw_fixation(fixtype='x', colour=(0,255,0), pos=(DISPSIZE[0]/2,DISPSIZE[1]/2), pw=3, diameter=15)
scr.draw_fixation(fixtype='dot', colour=(0,0,255), pos=(DISPSIZE[0]*0.75,DISPSIZE[1]/2), pw=3, diameter=15)
disp.fill(scr)
                       fontsize=30)
    exscreen.draw_text("Other",
                       pos=(cx - (side / 2) - ((yax * (1 - margin)) / 4), cy),
                       center=True,
                       fontsize=30)

    for j in range(p1):
        a = [xcor, ycor]
        b = [xcor + t_side, ycor]
        c = [xcor + t_side, ycor + t_side]
        d = [xcor, ycor + t_side]

        pointsown = [a, c, d]
        pointsother = [a, b, c]

        exscreen.draw_polygon(pointsown, colour=owncol, pw=1, fill=False)
        exscreen.draw_polygon(pointsother, colour=othercol, pw=1, fill=False)

        c = 0
        for k in range(2):
            c = 1 + k
            d = 2 - k
            A = (xcor + (d * tloc), ycor + (c * tloc))
            exscreen.draw_text(text=str(exvec[count]),
                               pos=A,
                               center=True,
                               fontsize=30)
            count += 1
        xcor += t_side
    ycor += t_side