psychopy.org | Reference | Downloads | Github

TextStim - how to set alignment?

#1

Quick Question: I am trying to display left aligned text using Builder TextStim,
but it all appears to be entered around the pos parameter.
In coder you’d use the alignHoriz parameter for this but this does not appear to be there in builder. WHat’s the best way to display different text elements (i.e. different TextStim objects) of variable length in a list, i.e. orderly one under the other, all left aligned?

THanks
Marc

#2

@Marc_Buehner, if you want to change the alignment of the text component bounding box, you can set the attribute at the beginning of a routine in a code component using text.alignHoriz = 'left'. Note, this does not align the text within the bounding box, only where the box lays on the position coordinates.

#3

HI there and thanks.
Yes, I have since realised that.
The question is: if use a code component in builder, would I need to have it in the ‘every frame’ tab? Because the ‘start of routine’ code is executed BEFORE the stims are defined and that would lead to errors?
And if it is every frame, would that incur performance issues?

Thanks

#4

When are you creating your text components? If you are using the Builder to create your text components, then they will be defined before the routine begins, so it should be ok.

#5

HI dvBridges – thanks. Yes, routine actually works! I must have mis-read the code!