Change Background Screen Color?

2,454 views
Skip to first unread message

DustinG

unread,
Aug 5, 2013, 9:02:55 PM8/5/13
to psychop...@googlegroups.com
PsychoPy Users,

I'm trying to design an experiment in which the background screen color changes with the presentation of certain stimuli. I'm trying to use the Builder view as much as possible to keep things simple. The trial structure is such that participants would be presented with a fixation cross, followed by an instruction, followed by an image, followed by the participant's rating of the image. These trials would be done in several blocks.

What I need to happen is for the background screen color to be grey during the fixation cross, blue during the instruction and image presentations, and then grey during the image rating.
There would need to be a different background screen color for each instruction, corresponding to the background screen color of the following image presentation (e.g., Instruction 1 = red background screen color and Instruction 2 = blue background screen color).

I am new to Python and PsychoPy, so any advice would be greatly appreciated!

Thanks,
DustinG

Jeremy Gray

unread,
Aug 5, 2013, 9:20:20 PM8/5/13
to psychop...@googlegroups.com
Hi Dustin,

try a code component with Begin Routine having:

win.setColor('darkred')  # or 'blue' or whatever


--Jeremy



--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/927d98b8-883b-43d2-bded-092c6a2a9448%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

DustinG

unread,
Aug 5, 2013, 10:19:23 PM8/5/13
to psychop...@googlegroups.com
Thanks Jeremy!

That definitely sets me in the right direction.

Is there a way to have background color change with different repeats of the trial? Attached to this reply is my excel spreadsheet with condition parameters. Hopefully that can provide a solid idea of how each repeat of the trial needs to go. Essentially the background color of the instructional cue needs to match the background color of the corresponding image. Each trial repeat would show a new cue and corresponding image.

Thanks!
Dustin
BlockEX.xlsx

Jonathan Peirce

unread,
Aug 6, 2013, 1:50:05 AM8/6/13
to psychop...@googlegroups.com
Actually I wouldnt use the screen setColor option - the way it works (using glClearColor) it only has an effect one frame later than expected.

Create a Grating Component with:
    texture=None
    mask = None
    size = 2
    units = norm

Make sure that's at the 'top' of your routine, meaing its code is executed first, so that it gets drawn before your other stimuli. Now you can control the color of your box on every trial as if it were a stimulus (it sort of is!)

Jon

For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/

rhutc...@ucdavis.edu

unread,
Mar 29, 2016, 3:44:55 AM3/29/16
to psychopy-users
Hi Jon, 

I am actually running into a similar problem. I was wondering if you could append the code that we should include as a code component in builder mode to solve this problem? I am having some trouble using the "GratingStim" code. 

Best, 
Ryan

Jonathan Peirce

unread,
Mar 29, 2016, 5:58:58 AM3/29/16
to psychop...@googlegroups.com
No need for code. Create a Grating Component (the button in the stimuli that looks a bit like the psychopy logo). Set its parameters as described below
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/8a0a2c82-3120-4c41-868e-e2e0a1bc6c32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jonathan Peirce
University of Nottingham

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.

Ryan Hutchings

unread,
Mar 29, 2016, 2:30:46 PM3/29/16
to psychop...@googlegroups.com
Thank you so much! 

--
You received this message because you are subscribed to a topic in the Google Groups "psychopy-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/psychopy-users/oCNV-ONVy7Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to psychopy-user...@googlegroups.com.

To post to this group, send email to psychop...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ryan Hutchings
Graduate Student
Social Cognition Lab
University of California - Davis
Reply all
Reply to author
Forward
0 new messages