psychopy.org | Reference | Downloads | Github

Scrolling Text from right to left

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 1.84.1
Standard Standalone? (y/n): Yey
What are you trying to achieve?:
Scrolling a Text from left to right, like normal reading.

What did you try to make it work?:
Tried in the ‘pos’ (position) field: [frameN, 0] and selected “set every frame” in the popup button next to that field. Like described here: https://groups.google.com/forum/#!topic/psychopy-users/LkNtXE8DJwY

**What specifically went wrong when you tried that?:
The text is moving too fast, it takes about two seconds to scroll a text with 300 words.

I tried to edit the code with “speed”, but it didn’t work.

Thanks :slight_smile:

Scrolling text.py (6.7 KB)

I cannot test this right now, but in the code you’re using,

text.setPos([frameN, 0], log=False)

it is obvious that the position is adjusted by one unit on the horizontal axis on every refresh, implying the text moves 60 units per second on a 60 Hz screen. In very rough mathematical terms, that’s a function x_pos = f(frameN) = frameN.

To change the speed of movement, you need to add some sort of “speed scaling factor”: f(frameN) = s * frameN.

So I would suggest trying something like:

text.setPos([0.5 * frameN, 0], log=False)

to reduce the speed to 50%.

Thank you, worked fine!

1 Like