standard.print
Audio Button Canvas Controller DropDown Html Image MediaRecorder Scale Text TextInput Tooltip Video Youtube
description
Adds the content of the element to the screen. This has no effect for non-visual elements such as the purely interactive Selector elements.
syntax
getX(ELEMENT_NAME).print()
alternate(s)
-
getX(ELEMENT_NAME).print(x,y)
-
getX(ELEMENT_NAME).print(x,y,canvas)
notes
- Since PennController 1.3, you can pass
x
andy
values to print the element at a specific position on the page, or on a Canvas element if you pass one (or the name of a Canvas element) as the third parameter. You can use any CSS coordinate format forx
andy
, or special string values following the respective formats"left|center|right at ..."
and"top|middle|bottom at ..."
. Note thatx
andy
are not supported for Audio, Canvas, Scale, TextInput, Video and Youtube elements in PennController 1.3 ; note also that elements added with.before
and.after
mess with proportional coordinates.
example(s)
@
@newImage( "smiley" , "ya.png" )
@,
@newCanvas( "myCanvas" , 100 , 100 )
@ .css( "border" , "solid 1px black" )
@ .center()
@ .add( "center at 50%" , "center at 50%" , getImage("smiley") )
$ .print()
- Prints the smiley image at the center of the canvas.