| Reference | Downloads | Github

TextStim alignment: alignHoriz broken, but alignText and anchorHoriz not implemented yet?

Hi PsychoPeeps!

PsychoPy version 3.2.4 on Python 3.6.10.

alignHoriz=“center” doesn’t actually align text horizontally, and passing either alignText or anchorHoriz to TextStim results in an error (unallowed keyword arguments).

This post alludes to the same issue, but it seems at that time alignHoriz still worked.

What should I do to make my alignment work?


Short story: Sorry yes, in the new release (currently testing 2020.1.rc2) this is fixed.

Why? a) Pyglet didn’t used to support horizontal alignment (with its text.Font classes) and we b) hadn’t implemented the switch (to the newer text.Label classes because they did support alignment but required a fair bit of digging to rewrite our code). We have now done that in the new release although I’m worried about the effects that will have on people’s code due to the new layout system in (b).

The unallowed keyword arguments error is because the keywords you’ve seen in the docs are in 2020.1, not in 3.2.4