Selector element

Selector elements let you create a group of existing elements out of which to make a selection, by clicking them or pressing a key.

Creation:

newSelector("mySelector")

Example:

[js try=”true”]newCanvas(“two shapes”, 820, 400)
.settings.add( 0, 0, newImage(“square”, “square.png”) )
.settings.add( 420, 0, newImage(“triangle”, “triangle.png”) )
.print()
,
newSelector(“shape”)
.settings.add( getImage(“square”) , getImage(“triangle”) )
.wait()
[/js]

The code above adds two images side by side and waits for a click on either one of them.

Commands

[yadawiki-list category=”NonTest command,Selector element”]

Tests

[yadawiki-list category=”Test command,Selector element”]