Changing entire screen background color within same experiment


Author
Message
seoho
seoho
Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)Associate Member (110 reputation)
Group: Forum Members
Posts: 1, Visits: 2
Hi,

I was wondering if it was possible to have trials and change the color of the screen background within the same experiment. Thank you.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
seoho - Wednesday, November 29, 2017
Hi,

I was wondering if it was possible to have trials and change the color of the screen background within the same experiment. Thank you.

I assume you mean something like different types of trials within the experiment having different screen background colors, right? If so, you can achieve that by having the respective <trial> elements display a <shape> covering the entire screen in the background. Set that <shape> to whatever color you need.

Example:


<block example>
/ trials = [1-6 = noreplace(a,b,c)]
</block>

// sets backgroundcolor to red
<trial a>
/ ontrialbegin = [
    shape.backgroundcolor.color = red;
]
/ stimulusframes = [1=clearscreen, backgroundcolor, a_stim]
/ validresponse = (57)
</trial>

// sets backgroundcolor to green
<trial b>
/ ontrialbegin = [
    shape.backgroundcolor.color = green;
]
/ stimulusframes = [1=clearscreen, backgroundcolor, b_stim]
/ validresponse = (57)
</trial>

// sets backgroundcolor to blue
<trial c>
/ ontrialbegin = [
    shape.backgroundcolor.color = blue;
]
/ stimulusframes = [1=clearscreen, backgroundcolor, c_stim]
/ validresponse = (57)
</trial>

<shape backgroundcolor>
/ shape = rectangle
/ color = white
/ erase = false
/ size = (100%, 100%)
</shape>

<text a_stim>
/ items = ("A1", "A2")
/ txcolor = white
/ txbgcolor = transparent
/ erase = false
</text>

<text b_stim>
/ items = ("B1", "B2")
/ txcolor = white
/ txbgcolor = transparent
/ erase = false
</text>

<text c_stim>
/ items = ("C1", "C2")
/ txcolor = white
/ txbgcolor = transparent
/ erase = false
</text>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search