Scrolling Text?

650 views
Skip to first unread message

Brian Drwecki

unread,
Feb 28, 2012, 11:13:06 PM2/28/12
to psychopy-users
Hey Wonderful People,

A student of mine is working on a moral dilemma type experiment. Like
the one's Joshua Greene runs with EPRIME (boo). We're both new to the
program. I'm definitely a builder type of guy, and he's motivated to
code things (but he's also a builder type of guy as well). The goal
is to make a paragraph scroll slowly from left to right (opposite of
the star wars scroll) a few words at a time. We're not too picky
right now, but we were wondering if there was a way to do this with
either the builder or the coder. Realize that we are novices when it
comes to the coder, so, the more help the better.

Here are two things that we were thinking of (and please don't laugh):
1) make a movie file of scrolling text, but the only problem is that
neither of us can figure out what software would allow us to make a
movie that is just text 2) use this very sad HTML code that I just
made...But we don't really know how to put HTML code into psychopy.

Realize that I know that this sounds totally stupid for those of you
who know how to code is python because there is probably some command
that allows us to export our dilemmas from the EXCEL file that holds
them to the screen in a scrolling from left to right manner.

So, if you were us, what would you do? And how would you do it?

Thanks

Brian and Steve

Just so you can laugh at me, here's my sad HTML code.

<body bgcolor ="Black">
<font size = "50" font color = "White">
<center>
<br>
<br>
<br>
<br>

<marquee behavior="scroll" direction="left" width = 250 scrollamount =
"7"> You are standing next to a fat man. That fat man. Is really
fat. A trolley comes at the fat man..... Ignore the words for now,
but you get the ponit. </marquee>
</center>




Michael MacAskill

unread,
Feb 28, 2012, 11:37:09 PM2/28/12
to psychop...@googlegroups.com
Dear Brian and Steve,

Welcome aboard!

PsychoPy has animation capabilities built-in (it can even produce and export movies itself (e.g. if you want to show your stimuli in PowerPoint/Keynote presentations)). But here you just want to animate stimuli directly.

e.g. create a text stimulus. In the 'pos' (position) field, type:
[frameN, 0] and select "set every frame" in the popup button next to that field.

Push the Run button and your text will move from left to right, at one pixel per screen refresh, but stay at a fixed y-coordinate. In essence, you can enter an arbitrary formula in the position field and the stimulus will be-redrawn at a new position on each frame. frameN here refers to the number of frames shown so far, and you can extend the formula to produce what you need.


Cheers,

Michael



On 29 Feb, 2012, at 17:13, Brian Drwecki wrote:

> So, if you were us, what would you do? And how would you do it?

--
Michael R. MacAskill, PhD michael....@nzbri.org
Research Director,
New Zealand Brain Research Institute

66 Stewart St http://www.nzbri.org/macaskill
Christchurch 8011 Ph: +64 3 3786 072
NEW ZEALAND Fax: +64 3 3786 080


Jonathan Peirce

unread,
Feb 29, 2012, 4:04:46 AM2/29/12
to psychop...@googlegroups.com
How much text are you talking about though? You might find performance
issues (jittering motion) if you try to render a lot of text in one go,
in which case you may have to switch to using images of text. But give
Michael's approach a try because it's definitely the most straight-forward.

Jon

On 29/02/2012 04:37, Michael MacAskill wrote:
> Dear Brian and Steve,
>
> Welcome aboard!
>
> PsychoPy has animation capabilities built-in (it can even produce and export movies itself (e.g. if you want to show your stimuli in PowerPoint/Keynote presentations)). But here you just want to animate stimuli directly.
>
> e.g. create a text stimulus. In the 'pos' (position) field, type:
> [frameN, 0] and select "set every frame" in the popup button next to that field.
>
> Push the Run button and your text will move from left to right, at one pixel per screen refresh, but stay at a fixed y-coordinate. In essence, you can enter an arbitrary formula in the position field and the stimulus will be-redrawn at a new position on each frame. frameN here refers to the number of frames shown so far, and you can extend the formula to produce what you need.
>
>
> Cheers,
>
> Michael
>
>
>
>
>
> On 29 Feb, 2012, at 17:13, Brian Drwecki wrote:
>
>> So, if you were us, what would you do? And how would you do it?

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Brian Drwecki

unread,
Feb 29, 2012, 9:26:33 AM2/29/12
to psychopy-users
Thanks guys, we'll implement this and provide an update on how it
works!

On Feb 28, 9:37 pm, Michael MacAskill <michael.macask...@otago.ac.nz>
wrote:
> Dear Brian and Steve,
>
> Welcome aboard!
>
> PsychoPy has animation capabilities built-in (it can even produce and export movies itself (e.g. if you want to show your stimuli in PowerPoint/Keynote presentations)). But here you just want to animate stimuli directly.
>
> e.g. create a text stimulus.  In the 'pos' (position) field, type:
> [frameN, 0] and select "set every frame" in the popup button next to that field.
>
> Push the Run button and your text will move from left to right, at one pixel per screen refresh, but stay at a fixed y-coordinate.  In essence, you can enter an arbitrary formula in the position field and the stimulus will be-redrawn at a new position on each frame. frameN here refers to the number of frames shown so far, and you can extend the formula to produce what you need.
>
> Cheers,
>
> Michael
>
> On 29 Feb, 2012, at 17:13, Brian Drwecki wrote:
>
> > So, if you were us, what would you do? And how would you do it?
>
> --
> Michael R. MacAskill, PhD               michael.macask...@nzbri.org

Brian Drwecki

unread,
Feb 29, 2012, 10:49:24 AM2/29/12
to psychopy-users
It works very well,. Here are some tips for other people who want to
create scrolling text in the future. I wanted my text to scroll from
right to left. So if you keep your eyes in the middle of the screen
the next word to read would come from the right (as if you were
actually reading text). The original formula posted above scrolls the
other way. So, you have to put a negative sign in front of the
formula for it to scroll the other way. However, when I first tried
this, it was not working. This is because you have to change the
units to pixel (which seems like common sense now, but at the time I
was confused). Also, you have to make sure you have an end time set,
otherwise it just flickers. I also set my letter height to 100
pixels. The other problem I had was that I wanted the text to start
blank and scroll into the screen. So, I wrote [2000-frameN, 0] and
this worked really well. We appreciate the help. FYI, this is the
best free experimental software out there, thanks for making it.

Brian and Steve

Thomas K.M.

unread,
Nov 6, 2012, 3:51:16 PM11/6/12
to psychop...@googlegroups.com
Nice stuff.
I just emulated the Star Wars intro :)

Benjamin Mader

unread,
Oct 6, 2016, 8:44:08 AM10/6/16
to psychopy-users
I've got another problem, the text is moving, but way too fast and i want to vary the moving speed.
Could you help me?

Thanks! :)

Richard Höchenberger

unread,
Oct 6, 2016, 9:44:35 AM10/6/16
to psychopy-users
Hi Benjamin, PsychoPy support has moved to http://discourse.psychopy.org/. You should probably ask your question there and include a reference to this Google Groups thread.
Reply all
Reply to author
Forward
0 new messages