getSelector(id).settings.enableClicks() Makes it possible to select by clicking (default). Example: [js highlight=”12″ try=”true”]newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.disableClicks() .settings.add( getImage(“square”) , getImage(“triangle”) ) .settings.keys( “F” , “J” ) .wait() .settings.enableClicks() [/js] Adds two images side by side and waits for a selection by pressing either the F key or …
Wiki Category Archives:
selector.settings.disableClicks
getSelector(id).settings.disableClicks() Makes it impossible to select by clicking. If no .settings.keys command is called on the element, this makes any selection impossible. Example: [js highlight=”8″ try=”true”]newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.disableClicks() .settings.add( getImage(“square”) , getImage(“triangle”) ) .settings.keys( “F” , “J” ) .wait() [/js] Adds two images side by side …
selector.settings.callback
getSelector(id).settings.callback( element ) or getSelector(id).settings.callback( function ) Will execute the command on the element upon next selection, or the function whenever selection happens. Example: [js highlight=”9″ try=”true”]newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) .settings.callback( getSelector(“shapes”).shuffle() ) .wait() [/js] Adds two images side by side. The positions …
standard.settings.selector
getElement(id).settings.selector( selectorName ) or getElement(id).settings.selector( getSelector(selectorName) ) (since beta 0.3) Since beta 0.3, Selector adds a .settings.selector command to all elements as another method for adding them to a selector. Example: [js highlight=”4,7″ try=”true”]newSelector(“shapes”) , newImage(“square”, “square.png”) .settings.selector(“shapes”) , newImage(“triangle”, “triangle.png”) .settings.selector(“shapes”) , newCanvas(“shapes canvas”, 825, 400) .settings.add( 0, 0, getImage(“square”) ) .settings.add(425, 0, getImage(“triangle”) …
selector.settings.add
getSelector(id).settings.add( element1, element2, … ) Adds as many elements to the selector. By default, selection is done through clicks. See .settings.keys and .settings.enableClicks and .settings.disableClicks. Example: [js highlight=”8″ try=”true”]newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) .wait()[/js] Adds two images side by side and waits for a …
selector.wait
getSelector(id).wait() or getSelector(id).wait(“first”) or getSelector(id).wait(test) Waits until one of the elements of the selector is selected before evaluating and executing the next commands. If you call wait(“first”), then if an element has already been selected before this command is evaluated, the next commands are evaluated and executed right away. If no element was selected before, …
selector.unselect
getSelector(id).unselect() (since beta 0.3) Unselects any element currently selected.
selector.shuffle
getSelector(id).shuffle() (since beta 0.3) or getSelector(id).shuffle( element1 , element2 , … ) Shuffles the elements that have been added to the selector so far, so their positions on the page are randomly switched (NB: make sure the elements are already printed when you call shuffle). You can specify a subset of elements to be shifted, …
selector.select
getSelector(id).select(element) Selects the specified element. Example: [js highlight=”9″ try=”true”]newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) .select( getImage(“square”) ) .wait()[/js] Adds two images side by side, selects the image square by default, and waits for a click on either one of them.
scale.test.selected
getScale(id).test.selected() or getScale(id).test.selected( value ) Tests whether a button is selected. If you pass a value, it will check that it matches the label of the selected button if it has a label, its index otherwise. If you do not pass a value, it simply checks that a selection happened. Example: [js highlight=”7″ try=”true”]newScale(“score”, 5) …