PennController for IBEX › Forums › Support › Issues with DashedSentence on new farm
Tagged: .
- This topic has 4 replies, 2 voices, and was last updated 3 years, 2 months ago by
zach.
-
AuthorPosts
-
May 6, 2021 at 1:14 pm #6933
zach
ParticipantHi Jeremy,
I’m having a strange bug using DashedSentence on the new farm, even after updating my PennController.js file to 2.0 alpha. I’m doing word-by-word speeded acceptability. I have an image of a character with a speech bubble, so the DashedSentence controller is printing in a Canvas element.
The first word appears in the correct place, but then it stays there, and the remaining words of the sentence appear word-by-word in a position below the correct position. (More precisely, only alternating words appear. Half of the words don’t appear at all.) Do you have any idea why this is happening? The relevant code is below. The exact same code works perfectly fine in the old farm, and I can just keep using it for now, but it would be nice to transition to the new one.
Thanks,
ZachnewImage("sb1", "personA_left_inplace.png") .settings.size(sb_width, sb_height) , newText("guise1_name", "Taylor") , newCanvas("sprcanv", canv_width, canv_height) .center() .add( sb_x_left, 0, getImage("sb1")) .print() , newController("DashedSentence", {s: row.Sentence, mode: "speeded acceptability", blankText: "+", display: "in place"}) .print( ds_x_left, ds_y , getCanvas("sprcanv") ) .log() .wait() .remove() , getCanvas("sprcanv").remove()
May 6, 2021 at 5:11 pm #6934Jeremy
KeymasterHi Zach,
For some reason using
print(x,y,canvas)
adds the Controller element twice onto the page. I need to fix this for the next release of PennController. In the meantime, usecanvas.add
:newController("DashedSentence", {s: row.Sentence, mode: "speeded acceptability", blankText: "+", display: "in place"}) , getCanvas("sprcanv") .add( ds_x_left, ds_y , getController("DashedSentence"))
Jeremy
May 26, 2021 at 11:24 pm #7000zach
ParticipantHi Jeremy,
A belated thanks for this! With
canvas.add
, I’m not sure how to getwait
to work properly. With the code below, it just hangs at the final word. Any idea how to fix this?Thanks,
ZachnewImage("sb1", "training_sb_inplace.png") .settings.size(sb_width, sb_height) , newCanvas("sprcanv", canv_width, canv_height) .center() .add( sb_x_left, 0, getImage("sb1")) .print() , newController("ds1", "DashedSentence", {s: row.SentenceText, mode: "speeded acceptability", blankText: "+", display: "in place"}) , getCanvas("sprcanv") .add(ds_x_left, ds_y , getController("ds1")) .wait() .remove()
May 27, 2021 at 9:19 am #7005Jeremy
KeymasterHi Zach,
You are calling
wait
on the Canvas element: there is nowait
command on Canvas elements. You want to call it on the Controller element instead:newImage("sb1", "training_sb_inplace.png") .size(sb_width, sb_height) , newController("ds1", "DashedSentence", {s: row.SentenceText, mode: "speeded acceptability", blankText: "+", display: "in place"}) , newCanvas("sprcanv", canv_width, canv_height) .center() .add( sb_x_left, 0, getImage("sb1")) .add(ds_x_left, ds_y , getController("ds1")) .print() , getController("ds1") .wait() , getCanvas("sprcanv") .remove()
(I called
remove
on the Canvas element, but since you meant to callwait
on the Controller element, I’m not sure which element you wanted to remove)Jeremy
June 7, 2021 at 12:25 pm #7031zach
ParticipantThis worked well – thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.