| Reference | Downloads | Github

Align Text component to the Left

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2.1.4
Standard Standalone? (y/n) If not then what?: Y
What are you trying to achieve?:

So PsychoPy by default aligns the text centrally for the text component. I am trying to align several components to align left. It is quite a peculiar problem because the Python string I am using works for some of the components and some of them it doesn’t.

What did you try to make it work?:

The string I am using is: Intro_text.alignText = ‘left’ (Intro_Text is the Text component name). Here is an example of where the string works.

Here is an example of where it does not work. Since it is in the code, I cannot take a screenshot of how the text looks.

I have attached the .psyexp code for anyone to look at. All of the strings are in the Begin Routine tab under the custom Python component.

Thank you in advance!

Testing_Questionnaire.psyexp (72.5 KB)

Are the code components above the text components?


This is a Builder view of the routine that works:

Builder view of the second routine that does not work:

Coder view of the one that works:

Coder view of the second one that does not work:

Here is a picture of the routine:

Second routine:

In the second case you have aligntext instead of alignText.