I cannot left align my text on Pavlovia

Hi,

In the experiment I am working on I am trying to align the text to the left. I have tried using both the text component in the builder and writing the code for a custom textsim, however the text is always center aligned on Pavlovia. The text works properly in both cases when running in the builder. Help would be very much appreciated! Thank you

Textsim code - in begin routine, auto->JS:
Text1 = visual.TextStim(win=psychoJS.window, name=‘Text1’,
text=sText,
font=‘Arial’,
pos=[0,0], height=0.035, wrapWidth=1.5, ori=0,
color=‘black’, colorSpace=‘rgb’, opacity=1,
languageStyle=‘LTR’, alignText=‘left’,
depth=-6.0);

EDIT: Added file

PSAP.psyexp (86.0 KB)

Hey,

I’m new to Psychopy so if there is anything else I can do to get some help on this I’d be glad to oblige. I just really can’t seem to get it to work despite getting a large portion of the rest of my experiment to work fine. If anyone has any ideas or needs more detail from me about something I’d love to hear it

Thank you :slight_smile:

Hello!

The problem is that alignText is a property of TextStim in “offline PsychoPy”, but not in the online version. Use alignHoriz instead, that should work.

2 Likes

If you created your experiment in Builder and used a TextStim component, it should be automatically centered in PsychoPy and automatically left-aligned in Pavlovia. If it’s not doing what you want in Pavlovia, using YourTextComponentName.setAlignHoriz(‘left’) in a code component should do the trick!

1 Like

Thank you very much for the response! I had seen this suggestion in other threads but I did not realize that this is a JS specific command

1 Like

Thank you!