Zooming in and out of a picture


Zooming in and out of a picture

Author
Message
newbie
newbie
New Member
New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)

Group: Forum Members
Posts: 3, Visits: 18
Hello.

I'm using an evaluative conditioning paradigm and I'd like the pictures to have the appearance of either being zoomed in and out on based on the participants response.
I've managed to achieve something similar just by making the picture reappear in a different size, but could someone help with the zoom feature?
Dave
Dave
Supreme Being
Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)Supreme Being (467K reputation)

Group: Administrators
Posts: 9K, Visits: 38K
newbie - Monday, September 3, 2018
Hello.

I'm using an evaluative conditioning paradigm and I'd like the pictures to have the appearance of either being zoomed in and out on based on the participants response.
I've managed to achieve something similar just by making the picture reappear in a different size, but could someone help with the zoom feature?

You'll have to implement something along the lines of the Approach Avoidance Task: https://www.millisecond.com/download/library/aat/

I.e. making the image re-appear in different size / manipulating the size at runtime (in- or decrease depending on response) is exactly the right approach. Here's a basic example, press i to "zoom in" (make the text object become larger), press o to "zoom out" (make the text object become smaller):

<values>
/ startheight = 50%
/ startwidth = 50%
/ width = 0%
/ height = 0%
/ zoomcount = 0
/ stepsize = 2.5%
/ nsteps = 20
/ itemnumber = 1
</values>

<block myblock>
/ trials = [1-4 = mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [
    values.itemnumber = list.itemnumbers.nextvalue;
    values.width = values.startwidth;
    values.height = values.startheight;
    text.mytext.width = values.width;
    text.mytext.height = values.height;
    values.zoomcount = 0;
]
/ stimulusframes = [1=clearscreen,mytext]
/ validresponse = ("i", "o")
/ branch = [
    if (trial.mytrial.response == 23) trial.zoomin;
]
/ branch = [
    if (trial.mytrial.response == 24) trial.zoomout;
]
</trial>

<trial zoomin>
/ ontrialbegin = [
    values.width += values.stepsize;
    values.height += values.stepsize;
    text.mytext.width = values.width;
    text.mytext.height = values.height;
    values.zoomcount += 1;
]
/ stimulusframes = [1=clearscreen, mytext]
/ validresponse = (0)
/ trialduration = 50
/ branch = [
    if (values.zoomcount < values.nsteps) trial.zoomin;
]
</trial>

<trial zoomout>
/ ontrialbegin = [
    values.width -= values.stepsize;
    values.height -= values.stepsize;
    text.mytext.width = values.width;
    text.mytext.height = values.height;
    values.zoomcount += 1;
]
/ stimulusframes = [1=clearscreen, mytext]
/ validresponse = (0)
/ trialduration = 50
/ branch = [
    if (values.zoomcount < values.nsteps) trial.zoomout;
]
</trial>

<list itemnumbers>
/ items = (1,2,3,4)
</list>

<text mytext>
/ size = (50%,50%)
/ vjustify = center
/ items = myitems
/ txbgcolor = blue
/ txcolor = white
/ erase = false
/ select = values.itemnumber
</text>

<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 3 = "C"
/ 4 = "D"
</item>

Things would work the same with <picture> elements.

newbie
newbie
New Member
New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)New Member (18 reputation)

Group: Forum Members
Posts: 3, Visits: 18
Dave - Monday, September 3, 2018
newbie - Monday, September 3, 2018
Hello.

I'm using an evaluative conditioning paradigm and I'd like the pictures to have the appearance of either being zoomed in and out on based on the participants response.
I've managed to achieve something similar just by making the picture reappear in a different size, but could someone help with the zoom feature?

You'll have to implement something along the lines of the Approach Avoidance Task: https://www.millisecond.com/download/library/aat/

I.e. making the image re-appear in different size / manipulating the size at runtime (in- or decrease depending on response) is exactly the right approach. Here's a basic example, press i to "zoom in" (make the text object become larger), press o to "zoom out" (make the text object become smaller):

<values>
/ startheight = 50%
/ startwidth = 50%
/ width = 0%
/ height = 0%
/ zoomcount = 0
/ stepsize = 2.5%
/ nsteps = 20
/ itemnumber = 1
</values>

<block myblock>
/ trials = [1-4 = mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [
    values.itemnumber = list.itemnumbers.nextvalue;
    values.width = values.startwidth;
    values.height = values.startheight;
    text.mytext.width = values.width;
    text.mytext.height = values.height;
    values.zoomcount = 0;
]
/ stimulusframes = [1=clearscreen,mytext]
/ validresponse = ("i", "o")
/ branch = [
    if (trial.mytrial.response == 23) trial.zoomin;
]
/ branch = [
    if (trial.mytrial.response == 24) trial.zoomout;
]
</trial>

<trial zoomin>
/ ontrialbegin = [
    values.width += values.stepsize;
    values.height += values.stepsize;
    text.mytext.width = values.width;
    text.mytext.height = values.height;
    values.zoomcount += 1;
]
/ stimulusframes = [1=clearscreen, mytext]
/ validresponse = (0)
/ trialduration = 50
/ branch = [
    if (values.zoomcount < values.nsteps) trial.zoomin;
]
</trial>

<trial zoomout>
/ ontrialbegin = [
    values.width -= values.stepsize;
    values.height -= values.stepsize;
    text.mytext.width = values.width;
    text.mytext.height = values.height;
    values.zoomcount += 1;
]
/ stimulusframes = [1=clearscreen, mytext]
/ validresponse = (0)
/ trialduration = 50
/ branch = [
    if (values.zoomcount < values.nsteps) trial.zoomout;
]
</trial>

<list itemnumbers>
/ items = (1,2,3,4)
</list>

<text mytext>
/ size = (50%,50%)
/ vjustify = center
/ items = myitems
/ txbgcolor = blue
/ txcolor = white
/ erase = false
/ select = values.itemnumber
</text>

<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 3 = "C"
/ 4 = "D"
</item>

Things would work the same with <picture> elements.

That's brilliant! Thank you.
GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search