I’m using Psychopy v2020.2.4 - I’m trying to set the alignment of my text to either ‘left’ or ‘center’, depending on the content of the text. Right now, I have:
Where Text_Color, Text_Position, Text, Text_Size, and Align are variables in an excel sheet. The task loads all of the other information correctly, but does not seem to update the alignment (the text is always displayed as center-aligned). The Align column in my excel file contains either [‘left’] or [‘center’].
If I add alignText=‘left’ into my code, I can get all the text to be left-aligned:
Text1 = visual.TextStim(win=win, name='Text1',
pos=[0,0], height=1.0, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
However, adding “Text1.setAlignText(Align)” further down in the code still does not seem to do anything:
With this line in place, the window opens but crashes before the tasks begins. I need the text to be aligned either left or center depending on the trial - so I need this line of code to draw from my excel sheet to set the alignment. Is setAlignText not an actual function? This seems like an oversight…
Thanks for your help!