Variable fixation dot position

PennController for IBEX Forums Support Variable fixation dot position

Tagged: 

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

    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: https://korpling.german.hu-berlin.de/ibexexps/plescaan/MGK_SFB_C03_L1_V2/experiment.html

    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!

    Best,
    Ana

    #8267
    Jeremy
    Keymaster

    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;'>"+
                        [...new Array(variable.context.length-3)].map(v=>'_').join('')+"</span>")
        .css({"font-size":"23px","font-family":"courier"})
        .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
    getText("start1_1").remove()
    ,
    // 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"})
        .center()
        .color("red")
        .print("center at 50%", "middle at 46%")
    ,
    // context sentence in SPR
    ...cumulative_ctxt(variable.context, "remove")
    ,
    getText("read_ctxt").remove()

    Jeremy

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