Creating flickering images


Author
Message
sharondan
sharondan
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 12, Visits: 79
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

Dave
Dave
Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /size for the <text> element, not just a font size. Fonts are weird, different glyphs in a given font have vastly different heights and widths, which I suspect is where the seeming discrepancy comes from.

Dave
Dave
Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
Dave - 8/11/2020
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /size for the <text> element, not just a font size. Fonts are weird, different glyphs in a given font have vastly different heights and widths, which I suspect is where the seeming discrepancy comes from.

As an aside, if I wanted to use text shapes / symbol glyphs to achieve blinking while ensuring the masking stimulus matches the glyph size, I'd set things up like this:

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = white
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=shape; 40=erasehape; 80=shape; 120=erasehape; 160=shape; 200=erasehape; 240 = shape; 280=erasehape; 320=shape; 360=erasehape; 400=shape; 440=erasehape]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>



sharondan
sharondan
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 12, Visits: 79
Dave - 8/12/2020
Dave - 8/11/2020
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /size for the <text> element, not just a font size. Fonts are weird, different glyphs in a given font have vastly different heights and widths, which I suspect is where the seeming discrepancy comes from.

As an aside, if I wanted to use text shapes / symbol glyphs to achieve blinking while ensuring the masking stimulus matches the glyph size, I'd set things up like this:

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = white
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=shape; 40=erasehape; 80=shape; 120=erasehape; 160=shape; 200=erasehape; 240 = shape; 280=erasehape; 320=shape; 360=erasehape; 400=shape; 440=erasehape]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>



Thanks Dave,
It was very helpful!
It seems that those text shapes are presented differently on Mac (looks good) and on Windows (not the same size outlined in black this can be seen from the editor). I'd presume that I would need to change the stimuli to pictures to solve it.
Thanks
Sharon


Attachments
Mac looks good.png (19 views, 83.00 KB)
WinShapeSizeNotTheSame.png (19 views, 6.00 KB)
Dave
Dave
Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
sharondan - 8/12/2020
Dave - 8/12/2020
Dave - 8/11/2020
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /size for the <text> element, not just a font size. Fonts are weird, different glyphs in a given font have vastly different heights and widths, which I suspect is where the seeming discrepancy comes from.

As an aside, if I wanted to use text shapes / symbol glyphs to achieve blinking while ensuring the masking stimulus matches the glyph size, I'd set things up like this:

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = white
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=shape; 40=erasehape; 80=shape; 120=erasehape; 160=shape; 200=erasehape; 240 = shape; 280=erasehape; 320=shape; 360=erasehape; 400=shape; 440=erasehape]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>



Thanks Dave,
It was very helpful!
It seems that those text shapes are presented differently on Mac (looks good) and on Windows (not the same size outlined in black this can be seen from the editor). I'd presume that I would need to change the stimuli to pictures to solve it.
Thanks
Sharon


Not seeing this under Windows. Here's the code

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = red
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=clearscreen, shape, erasehape;]
/ validresponse = (57)
/ screencapture = true
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>

and here's the screen captures of the shapes overlayed (red on top of blue); the blue shape is not visible.
Attachments
sharondan
sharondan
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 12, Visits: 79
Dave - 8/12/2020
sharondan - 8/12/2020
Dave - 8/12/2020
Dave - 8/11/2020
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /size for the <text> element, not just a font size. Fonts are weird, different glyphs in a given font have vastly different heights and widths, which I suspect is where the seeming discrepancy comes from.

As an aside, if I wanted to use text shapes / symbol glyphs to achieve blinking while ensuring the masking stimulus matches the glyph size, I'd set things up like this:

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = white
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=shape; 40=erasehape; 80=shape; 120=erasehape; 160=shape; 200=erasehape; 240 = shape; 280=erasehape; 320=shape; 360=erasehape; 400=shape; 440=erasehape]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>



Thanks Dave,
It was very helpful!
It seems that those text shapes are presented differently on Mac (looks good) and on Windows (not the same size outlined in black this can be seen from the editor). I'd presume that I would need to change the stimuli to pictures to solve it.
Thanks
Sharon


Not seeing this under Windows. Here's the code

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = red
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=clearscreen, shape, erasehape;]
/ validresponse = (57)
/ screencapture = true
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>

and here's the screen captures of the shapes overlayed (red on top of blue); the blue shape is not visible.

Thanks Dave,
The shapes are not the same size on the screen (triangle and circle for instance). In your example, you used  / 1 = "●"  while I've chosen a different stimulus "⚫" - where the behaviour on Mac and Win is different (I'd say it is OS different and not Inquisit). Please note that any kind of 3 different filled shapes will do the job as long as they are presented on the screen in the same size.
Attached please find my code, I'm still working on it so apologies for the mess. The file to run is FD_Exp (search on your name will point out the issues).
Thanks,
Sharon.


Attachments
Test4Dave.zip (16 views, 203.00 KB)
Dave
Dave
Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
sharondan - 8/12/2020
Dave - 8/12/2020
sharondan - 8/12/2020
Dave - 8/12/2020
Dave - 8/11/2020
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /size for the <text> element, not just a font size. Fonts are weird, different glyphs in a given font have vastly different heights and widths, which I suspect is where the seeming discrepancy comes from.

As an aside, if I wanted to use text shapes / symbol glyphs to achieve blinking while ensuring the masking stimulus matches the glyph size, I'd set things up like this:

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = white
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=shape; 40=erasehape; 80=shape; 120=erasehape; 160=shape; 200=erasehape; 240 = shape; 280=erasehape; 320=shape; 360=erasehape; 400=shape; 440=erasehape]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>



Thanks Dave,
It was very helpful!
It seems that those text shapes are presented differently on Mac (looks good) and on Windows (not the same size outlined in black this can be seen from the editor). I'd presume that I would need to change the stimuli to pictures to solve it.
Thanks
Sharon


Not seeing this under Windows. Here's the code

<text shape>
/ items = shapeitems
/ txcolor = blue
/ fontstyle = ("Arial", 10%)
/ select = sequence
/ erase = false
</text>

<text erasehape>
/ items = shapeitems
/ txcolor = red
/ fontstyle = ("Arial", 10%)
/ select = text.shape.currentindex
/ erase = false
</text>

<item shapeitems>
/ 1 = "●"
/ 2 = "▲"
/ 3 = "■"
</item>

<trial blink>
/ stimulustimes = [0=clearscreen, shape, erasehape;]
/ validresponse = (57)
/ screencapture = true
</trial>

<block myblock>
/ trials = [1-3 = blink]
</block>

and here's the screen captures of the shapes overlayed (red on top of blue); the blue shape is not visible.

Thanks Dave,
The shapes are not the same size on the screen (triangle and circle for instance). In your example, you used  / 1 = "●"  while I've chosen a different stimulus "⚫" - where the behaviour on Mac and Win is different (I'd say it is OS different and not Inquisit). Please note that any kind of 3 different filled shapes will do the job as long as they are presented on the screen in the same size.
Attached please find my code, I'm still working on it so apologies for the mess. The file to run is FD_Exp (search on your name will point out the issues).
Thanks,
Sharon.


Problem is with the specific characters you've chosen, here and here:



Those aren't typical font glyphs, they're Unicode emoji characters

"Black Medium Square"
https://emojipedia.org/black-medium-square/

and

"Medium Black Circle"
https://emojipedia.org/black-circle/

Platforms / OSes are sort of free to choose and vary in how they render those emoji, so this is caused by platform differences, not Inquisit.

You won't find three shape characters or glyphs that have exaclty the same size, so maybe you should work with <shape> elements to begin with or indeed go for <picture> items.


sharondan
sharondan
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 12, Visits: 79
Dave - 8/13/2020
sharondan - 8/12/2020
Dave - 8/12/2020
sharondan - 8/12/2020
Dave - 8/12/2020
Dave - 8/11/2020
sharondan - 8/11/2020
Hi,
I'm trying to make flickering images (4 stimuli that will flicker in a different rate)
One thing I've noticed is that when using regular text (for instance letters) the size of the masking shape has to be bigger than the stimuli (the text size is set by fontstyle with percentage of screen size, background colour is transparent) in a factor of 1.35. For some reason, the width is completely overlapped but there are some variation with hight. (please see enclosed the debugger window). So there is still some portion of the text that is not covered by the mask. 
I had to increase the size of the mask by a factor of 1.31 in order to cover fully the stimuli.
Here is a short example:

<item shapeItems>
/1 = "o" //primary
/2 = "o" //secondary
/3 = "o" //always
</item>

<text flickerSimLow_1>
/ items = item.shapeItems
/ txcolor = black
/ txbgcolor = transparent
/ select = list.aShapePrimaryLow.nextvalue
</text>

<shape blankLow_1>
/ color = parameters.globalScreenColor
/shape = rectangle
/ size = (text.flickerSimLow_1.widthpct*values.multBlankStimRatio_w, text.flickerSimLow_1.heightpct*values.multBlankStimRatio_h)
/ position = (text.flickerSimLow_1.hposition, text.flickerSimLow_1.vposition)
</shape>

============================End example ========================================
Note that even though the percentage is the same, pixel-wise they are not.
Changing the mask shape to be as the same pixels of the text does not help either.


BTW
Originally the flickering was made by these text shapes  "⚫", "▲", ""◼", but due to the problem I've changed it to be 4 stimuli that are the same and the problem still exist. 

Any idea why this happens and would it be the same for pictures?

It would be really helpful if your example code contained any and all actual values and definitions it needs to run. Anyway, what you'll want to do is define a proper /