In the included image, all text strings were drawn at the same X position. There are two blatant things wrong here:
-
the strings “anchor right” and “anchor left” are both drawn with the x position represented by the red vertical, yet neither string is remotely close to that line.
-
the strings “anchor right” and “ancRight” should be flush on the right-hand side (ideally flush to the red line), instead they are centered along some imaginary axis.
psychopy.version 2022.1.3
from psychopy import visual, core, event, gui
import psychopy
windowWidth = 1024
windowHeight = 768
winColor = (1,1,1)
win = visual.Window(size = [windowWidth, windowHeight], fullscr = False, color=winColor, units="pix")
lineTemp = visual.Line(win, (-512, 0),(512, 0), lineWidth = 1.5, lineColor ="red" )
lineTemp.draw()
lineTemp = visual.Line(win, (0, -384),(0, 384), lineWidth = 1.5, lineColor ="red" )
lineTemp.draw()
theText = visual.TextStim(win, "anchorLeft", height = 20, pos = (0,0), color = "black", anchorHoriz = "left" )
theText.draw()
theText = visual.TextStim(win, "anchorRight", height = 20, pos = (0,0), color = "black", anchorHoriz = "right" )
theText.draw()
theText = visual.TextStim(win, "ancRight", height = 20, pos = (0,-40), color = "black", anchorHoriz = "right" )
theText.draw()
theText = visual.TextStim(win, "ancLeft", height = 20, pos = (0,-40), color = "black", anchorHoriz = "left" )
theText.draw()
win.flip()