Building a slider with latest version of OpenSesame
Hi,
I know that there have been a lot of questions about this but I still haven't been able to find a solution that works the best with my program. I am trying to create a program where users can use a slider or a rating scale to show how much they agree with a statement. All of the sliders that I have tried to use have not shown up on my screen correctly (they always shown up on the bottom right side of my screen instead of the center). I've followed all of the steps of moving the slider files into the 'plug-in' folder of OpenSesame and moving some other files into the 'multiple-choice' folder but I'm still having these issues. I was wondering if this is an issue with the fact that the sliders are from 2011/2012 or if there is another issue happening.
Thanks!
Comments
Hi,
In OpenSesame 2.9 and before, coordinates were relative to the top-left of the display in inline script, and relative to the display center in sketchpad items. This was clearly inconsistent, so in OpenSesame 3.0, coordinates are by default relative to the display center in all cases.
So this is why the slider appears at the bottom right--it assumes that 0,0 is the top-left. To fix this, you can either:
Does that help? If want a more specific answer, you'll need to provide some more concrete information about what approach you're trying exactly.
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks for your response,
I'm still a little confused, because I can't seem to find a part of the code that says 'display-center' and i cant find a general-properties tab in the version of OpenSesame that I'm using.
If I were to use this inline code for a slider that I you posted on an earlier forum post, what would I change to center the slider?
Sorry that didn't show up as expected (I'm clearly not used to using this at all), this is what I meant: http://img.cogsci.nl/?q=570c59d642639
It's the tab that you see when you click on the top-level item in the overview area, where you can change the name, resolution, etc.
It's this part:
It determines the position of the slider relative to the width/2 and height/2, that is, relative to the center (when 0,0 is the top-left.)
The following is a slight update of the script above. This will work on OpenSesame >= 3, and assumes that Uniform coordinates is enabled (it is by default for new experiments).
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thank you!!
Hi Guys,
I have a similar question but couldn't directly figure out what to do exactly.
So basically this is my code (i didn't set up a custom form but I just used a sketchpad)
So basically: "draw textline center=1 color=black font_bold=no font_family=mono font_italic=no font_size=24 html=yes show_if=always text="1 2 3 4 5 6 7" x=564 y=0 z_index=0"
Is where I set a 1-7 scale. Then people can use the keyboard to answer by pressing whatever number from 1-7.
I now want to change this to a 0-100 slider where people can use a mouse to give the input.
I feel like this should be relatively straightforward but it's not obvious to me how to fix it. My python is very limited haha so I googled around and arrived at this point
@Eva This may be useful:
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan thanks
!
So thanks a lot!
I checked with a colleague and basically found out which is also clear from your post that you need to do some real python coding to make it work rather than to have a sneaky way to do it quickly in sketchpad.
Though I really like your solution where you can basically code the slider first and then integrate it into the sketchpad