Variable fixation dot position

PennController for IBEX Forums Support Variable fixation dot position


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #8265

    Hi Jeremy,

    I am working on an SPR experiment and this time around I intend to print all sentences in the center of the screen, but since the sentence length is variable depending on item type, it has become somewhat difficult to accurately determine the position of the fixation dots. Everything works good for the short sentences, but not for the longer ones. Here is the link to the experiment so you can get a sense of what I mean with the fixation dot placement:

    Is there any way to keep the printing location variable on sentence length? I am not quite sure how to proceed and would be very grateful for any tips!

    Thank you!



    Hi Ana,

    Are you trying to align ... with the start of the SPR sentence? If so, since you use a mono-spaced font to display the SPR sentence, you can simply pass a string of the same length to the three-dot Text element and it will be the exact same size as the SPR sentence, so if you print it at the same coordinates, they will be perfectly aligned. The trick is to make that string start with ... and render all remaining (dummy) characters invisible, eg:

    // dots 1_1
    newText("start1_1", "...<span style='visibility: hidden;'>"+
                        [ Array(variable.context.length-3)].map(v=>'_').join('')+"</span>")
        .print("center at 50%", "middle at 50%")
    // Keep the dots in place for about a second 
    newTimer("start1_1_timer", 1000).start().wait()
    // Remove the dots
    // context sentence
    newText ("read_ctxt","Lies bitte den ersten Satz und drücke die Leertaste um fortzufahren")
        .css({"font-size":"15px","font-family":"times new roman"})
        .print("center at 50%", "middle at 46%")
    // context sentence in SPR
    ...cumulative_ctxt(variable.context, "remove")


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.