Back
Login
Register
Login
Register
Millisecond Forums
Home
»
Millisecond Forums
»
Inquisit 4
»
Dynamic screen variables
Dynamic screen variables
Post Reply
Like
25
1
2
Next
Jump To Page
Dynamic screen variables
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
zajac
zajac
posted 11 Years Ago
ANSWER
HOT
Topic Details
Share Topic
Group: Forum Members
Posts: 28,
Visits: 98
Hi guys. I am doing a fair bit of programming on a small laptop, but the actual testing of participants is done on 22" monitors. If I set my position parameters in %, I can't control the distance between them (in terms of pixels). If I define positions using pixels, then the way I define them for the bigger monitors means they won't display properly on a smaller monitor.
Imagine the following scenario. I have four squares that I want to display centrally. Each square will be positioned 50px from the centre most point. The large monitors have a vertical resoultion of 1080, so mid screen is 510px. On the laptop though, vertical resolution is 768px. So if I use the same program on the laptop it won't display centrally.
What I'm thinking is dynamically defining a position. For instance, can I create a variable (displaypos) which equals (verticalresolution/2)? Then, I could display images using verticalposition = displaypos?
Hoping someone has a fix for this issue. Maybe it's easier than I think? Anyway, thanks in advance for any advice!
Ian.
Reply
Like
25
Dave
Dave
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 13K,
Visits: 108K
> What I'm thinking is dynamically defining a position. For instance, can I create a variable (displaypos) which equals (verticalresolution/2)?
Yes, you can do that. You'll want to use the display.width and/or display.height properties to do that. Details can be found in the documentation for the <display> element. Note that width and height are returned as pure integers, so you'll have to multiply by 1px to convert to pixels.
Reply
Like
23
zajac
zajac
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 28,
Visits: 98
Ok, so I'm not really getting anywhere with this. I have the following trial which is a cue image which I want to display centrally. I'm trying to set the position to be defined using an expression. I know that I can show centrally using 50%,50%. I'd rather use the expression for consistency though, and as a test to check I'm getting it right.
I first tried to define a vertical resolution and horizontal resolution value so that I can call these in expressions.
<values>
/ vertres=display.height
/ horizres=display.width
</values>
Then, I tried to call these for the position of the trial as follows:
<picture cuepic>
/ items = ("cue.jpg")
/ size = (100px,100px)
/ position = (values.vertres/2,values.horizres / 2)
</picture>
I'm not getting any errors and the script runs ok, I just can't see the cue at all. What am I doing wrong?
Thanks in advance
Reply
Like
21
Dave
Dave
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 13K,
Visits: 108K
As already mentioned in my previous reply, you ought to multiply by pixels to cast the expression to the correct unit:
<values>
/ vertres = 1px * display.height
/ horizres = 1px * display.width
</values>
Reply
Like
22
zajac
zajac
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 28,
Visits: 98
Apologies for missing that part, Dave. Thanks for your help. All sorted.
Reply
Like
22
Dave
Dave
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 13K,
Visits: 108K
No worries -- I probably should have made the point more salient to begin with. Let me know if anything else comes up!
Reply
Like
22
zajac
zajac
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 28,
Visits: 98
Now just another quick question about <summarydata> : Can I get it to store meanlatency for an RT task, as per the last line of the raw data file? I'm guessing that I will need to define this in the script somewhere within values or variable, and then enter it as a summary column (i.e., values.meanlatency)
I've had a bit of a look through the help documentation, but am admittedly a little lost.
Thanks
Reply
Like
19
Dave
Dave
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 13K,
Visits: 108K
You either need to compute mean latency using <values> and log the respective value to the data file or do the same using one of the built-in meanlatency properties.
Reply
Like
20
zajac
zajac
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 28,
Visits: 98
Dave - just a quick question again: Is it possible to have a sound stimulus play on response? We're trying to put together a 'fruit squash' type game and when participants press the fruit we'd like to have a 'squash' sound played. Is this possible?
Ian.
Reply
Like
21
zajac
zajac
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 28,
Visits: 98
Never mind - I'm pretty sure I can call it as a correctmessage=true(sound,200) etc.....
Reply
Like
21
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
25
1
2
Next
Jump To Page
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Facebook
Explore
Messages
Mentions
Search