Field Summary
Field Attributes Field Name and Description
 
%
Obtains the reminder of dividng a value with another value
 
%=
Stores in a variable the remaining of dividing it with another value
 
*
Multiplies two values
 
+
Adds to values
 
++
Increments in 1 the value of a variable.
 
+=
Adds a number to the value in a variable
 
-
Substracts a value from another value
 
--
Decrements in 1 the value of a variable.
 
/
Divides two values
 
/=
Divides a variable with a value
 
=
Assigns a value to a variable
 
Allows to declare a variable containing several values
 
Breaks the execution of a loop (in while, for or repeat)
 
Breaks the execution of a loop iteration (in while, for or repeat) and continues to the next iteration
 
Fills the shape described within its block
 
for
Allows to iterate based on a condition
 
Allows to encapsulate groups of instructions
 
if
Allows to branch the code
 
Allows to iterate a specific amount of times It updates a variable repeatCount which starts at 0 and increments on every iteration
 
Break the execution of a function and return to the caller
 
var
Allows to declare a variable
 
Allows to iterate based on a condition
Method Summary
Method Attributes Method Name and Description
 
animate(command, seconds, count, timeoutHandlersIndex)
Starts an animation, returns an animation handler It will run a code on every specified time until the code returns false or an amount of times is specified
 
Animate layers by displaying them one at a time
 
arc(radius, degrees, follow, counterclockwise)
 
ask(message, initial_value, timeout)
 
Defines the beginning of a shape definition
 
changeAxis(posx, posy, xScale, yScale)
Changes the axis of the whiteboard
 
clean(id)
Deletes all content in a layer
 
Defines the end of a shape definition
 
forward(pixels)
 
Returns the layer's guide's position's angle Angle 0 is when the guide is looking horizontally right
 
getArccosine(angle)
Returns the arccosine of an angle
 
getArcsine(angle)
Returns the arcsine of an angle
 
Returns the arctangent of an angle
 
Gets whether the future text will be bold in the currently active layer
 
getCharFromCode(keyCode)
Returns the character corresponding to a key code
 
Gets the color of the future draw lines and text in the currently active layer
 
getCosine(angle)
Returns the cosine of an angle
 
Returns the current day of the month
 
Gets the font name of the future text in the currently active layer
 
Returns the current hour
 
Returns the current input position
 
Gets whether the future text will be italic in the currently active layer
 
Returns the value of the key that is being pressed in the keyboard
 
Returns the value of the last key in the keyboard that was being pressed and marks it as processed so the next call to getKeyboardLastKey() doesn't give it again
 
Checks if a key in the keyboard is being pressed
 
getLayerExists(layerId)
Returns whether the layer exists
 
Returns the height of the layer
 
Returns as a value the image visible in the specified layer
 
Returns the layer name
 
Returns if the specified layer is visible or hidden
 
Returns the width of the layer
 
Returns the current millisecond within the current second in time
 
Returns the current minute
 
Returns the current month
 
getPixelColor(x, y, layer)
Returns the color in a certain coordinate in the current layer
 
Returns the horitzontal position of the pointer the last time it was clicked (mouse or touch gesture) in the whiteboard
 
Returns the vertical position of the pointer the last time it was clicked (mouse or touch gesture) in the whiteboard
 
Checks whether the pointer (mouse or touch gesture) is over the whiteboard
 
Checks whether the pointer (mouse or touch panel) is being pressed (click if its a mouse, touch if its a tocuh device)
 
Returns the horitzontal position of the pointer (mouse or touch gesture) in the whiteboard
 
Returns the vertical position of the pointer (mouse or touch gesture) in the whiteboard
 
Returns a random color
 
getRandomNumber(upperbound)
Returns a positive random integer number
 
getRGB(red, green, blue)
Returns a color from RGB components
 
Returns the current second
 
getSine(angle)
Returns the sine of an angle
 
Gets the size of the future draw lines and text in the currently active layer
 
getSquareRoot(number)
Returns the square root of the number
 
getTangent(angle)
Returns the tangent of an angle
 
Returns a timestamp of the current hour
 
Returns the current day of the week
 
getX(id)
Returns the layer's guide's position's X coordinate
 
getY(id)
Returns the layer's guide's position's Y coordinate
 
Returns the current year
 
goTo(posx, posy)
 
 
 
 
 
 
hide(id, hide)
Hides a layer
 
image(src, posx, posy, centered, width, height, rotation, flipX, flipY)
Puts an image in the specified position of the whiteboard
 
input(type)
Reads from the input area
 
inputReset(position)
Sets the position of the input pointer to a fixed place
 
line(destinationx, destinationy)
 
lineAt(originx, originy, destinationx, destinationy)
Draws a line from a coordinate to another using user coordinates
 
output(text, newline)
Writes in the output area
 
pop(id)
Deletes a layer
 
pull(levels, id)
Pulls a layer up in the layers order Upper layers overlap lower layers
 
push(levels, id)
Pushes a layer down in the layers order Upper layers overlap lower layers
 
say(message, timeout)
 
setAxis(firstX, lastX, firstY, lastY)
Changes the axis of the whiteboard
 
setBold(bold)
Sets the bold property in future text writes in the currently active layer
 
setColor(color)
Sets the color of the future draw lines and text in the currently active layer
 
setFont(font)
Sets the font to use in future text writes in the currently active layer
 
setItalic(italic)
Sets the italic property in future text writes in the currently active layer
 
setSize(size)
Sets the size of the future draw lines and text in the currently active layer
 
show(id, show)
Shows a layer
 
Creates a clone of the current layer in another layer, returns the layer name
 
sound(source, background, loop, audioHandlersIndex)
 
stop()
Stops the execution of any future code
 
stopSound(audioHandlersIndex)
Stop playing an audio file in the background
 
transparency(value, id)
Sets the layer transparency
 
turnLeft(angle)
 
turnReset(angle)
 
turnRight(angle)
 
unanimate(timeoutHandlersIndex)
Stops an animation
 
Unsets the bold property in future text writes in the currently active layer
 
Sets the draw color to be transparent in the currently active layer
 
Resets the font to use in future text writes in the currently active layer
 
Unsets the italic property in future text writes in the currently active layer
 
Resets the size of the future draw lines and text in the currently active layer
 
use(id)
Switches the currently active layer, returns the layer name
 
wait(milliseconds)
 
windowButtonCreate(windowId, id, text, posx, posy, width, height, action)
Creates an existing window button
 
windowButtonEdit(id, text, posx, posy, width, height, action)
Edits an existing window button
 
Hides a window button
 
Deletes a window button
 
Shows a window button if it was hidden
 
Removes all elements in a window
 
Hides the current window
 
windowImageCreate(windowId, id, canvasId, posx, posy, width, height, onclick, onmouseover, onmouseout)
Creates a window embedded image
 
windowImageEdit(id, canvasId, posx, posy, width, height, onclick, onmouseover, onmouseout)
Edits an existing window embedded image
 
Hides a window image
 
Deletes a window image
 
Shows a window image if it was hidden
 
windowInputCreate(windowId, id, posx, posy, width, height, type)
Creates a window input box
 
windowInputEdit(id, posx, posy, width, height, type)
Edits an existing window input box
 
Returns the value in the window input box
 
Hides a window input box
 
Deletes a window input box
 
windowInputSet(id, value)
Edits an existing window input box
 
Shows a window input box if it was hidden
 
Shows the current window
 
windowTextCreate(windowId, id, text, posx, posy, width, bold, italic, size, color, family)
Creates a window static text
 
windowTextEdit(id, text, posx, posy, width, bold, italic, size, color, family)
Edits an existing window static text
 
Returns the text in the window static text
 
Hides a window static text
 
Deletes a window static text
 
Shows a window static text if it was hidden
 
Changes the active window
 
write(text)
Writes text at guide's position
 
writeAt(text, posx, posy, angle)
Writes text at a specific position
Field Detail
%
Obtains the reminder of dividng a value with another value
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
10 % 3
Since:
1.0

%=
Stores in a variable the remaining of dividing it with another value
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
seconds %= 60;
Since:
1.0

*
Multiplies two values
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
3 * 6
Since:
1.0

+
Adds to values
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
5 + 10
Since:
1.0

++
Increments in 1 the value of a variable. If placed before the variable name it will increment before using the variable, if placed after the variable name the variable will first be used and only then incremented
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
i++;
Since:
1.0

+=
Adds a number to the value in a variable
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
count += 2;
Since:
1.0

-
Substracts a value from another value
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
10 - 8
Since:
1.0

--
Decrements in 1 the value of a variable. If placed before the variable name it will decrement before using the variable, if placed after the variable name the variable will first be used and only then decremented
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
--i;
Since:
1.0

/
Divides two values
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
40 / 4
Since:
1.0

/=
Divides a variable with a value
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
total /= 2;
Since:
1.0

=
Assigns a value to a variable
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
a = "Melina"
Since:
1.0

array
Allows to declare a variable containing several values
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
array thisIsAnArray
Since:
1.0

break
Breaks the execution of a loop (in while, for or repeat)
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
for (var i = 0; i < list.length; i++) { output(i, true); if (i > 20) break; }
Since:
1.0

continue
Breaks the execution of a loop iteration (in while, for or repeat) and continues to the next iteration
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
for (var i = 0; i < list.length; i++) { output(i, true); if (i % 2 == 0) continue; }
Since:
1.0

fill
Fills the shape described within its block
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
fill("red") { forward(100); turnLeft(90); forward(100); }
Since:
3.1

for
Allows to iterate based on a condition
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
for(var i = 0; i < list.length; i++) { write(list[i]); }
Since:
1.0

function
Allows to encapsulate groups of instructions
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
function test(parameter) { if (parameter=="test") write("correct!"); }
Since:
1.0

if
Allows to branch the code
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
if(isWrong) { write("Wrong answer!"); }
Since:
1.0

repeat
Allows to iterate a specific amount of times It updates a variable repeatCount which starts at 0 and increments on every iteration
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
repeat(4) { forward(100); turnLeft(90); }
Since:
1.0

{*} return
Break the execution of a function and return to the caller
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
return true;
Since:
1.0

var
Allows to declare a variable
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
var thisIsAVariable
Since:
1.0

while
Allows to iterate based on a condition
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
while(a < 4) { write(a); a = a+1; }
Since:
1.0
Method Detail
{Number} animate(command, seconds, count, timeoutHandlersIndex)
Starts an animation, returns an animation handler It will run a code on every specified time until the code returns false or an amount of times is specified
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
animate("stepForward()", 0.25)
Parameters:
{String|Function} command
Code to run on every
{Number} seconds Optional, Default: 0.5
Seconds between each code run
{Number} count Optional
Maximum amount of times to run the animation
{Number} timeoutHandlersIndex Optional
Animation handler to use
Since:
2.0
Throws:
Code execution exception
Returns:
{Number} Animation handler or false if the animation stopped

animateLayers(delay)
Animate layers by displaying them one at a time
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
animateLayers(0.1)
Parameters:
{Number} delay Optional, Default: 0.5
Since:
2.1

arc(radius, degrees, follow, counterclockwise)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
radius
degrees
follow
counterclockwise

ask(message, initial_value, timeout)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
message
initial_value
timeout

beginShape()
Defines the beginning of a shape definition
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
beginShape()
Since:
1.0

changeAxis(posx, posy, xScale, yScale)
Changes the axis of the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
changeAxis(200, 200)
Parameters:
{Number} posx Optional, Default: 0
X position of the vertical axis, origin us upperleft corner
{Number} posy Optional, Default: 0
Y position of the horizontal axis, origin us upperleft corner
{Number} xScale Optional, Default: 1
Scale by which to multiply the x coordinates, originaly increasing from left to right
{Number} yScale Optional, Default: 1
Scale by which to multiply the y coordinates, originaly increasing downwards
Deprecated:
since version 2.4
Since:
2.1

clean(id)
Deletes all content in a layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
clean()
Parameters:
{Number|String} id Optional
Layer id. If missing, currently active layer
$e.backend.whiteboard.layers.current.name
Since:
1.0

endShape()
Defines the end of a shape definition
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
endShape()
Since:
1.0

forward(pixels)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
pixels

{Number} getAngle(id)
Returns the layer's guide's position's angle Angle 0 is when the guide is looking horizontally right
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getAngle()
Parameters:
{Numbe|Stringr} id Optional
Layer id
Since:
1.0
Returns:
{Number} The layer's guide's position's angle

{Number} getArccosine(angle)
Returns the arccosine of an angle
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getArccosine(90)
Parameters:
{Number} angle
Angle
Since:
1.0
Returns:
{Number} Arccosine of an angle

{Number} getArcsine(angle)
Returns the arcsine of an angle
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getArcsine(90)
Parameters:
{Number} angle
Angle
Since:
1.0
Returns:
{Number} Arcsine of an angle

{Number} getArctangent(angle)
Returns the arctangent of an angle
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getArctangent(90)
Parameters:
{Number} angle
Angle
Since:
1.0
Returns:
{Number} Arctangent of an angle

getBold()
Gets whether the future text will be bold in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getBold()
Since:
3.0

{Number} getCharFromCode(keyCode)
Returns the character corresponding to a key code
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getCharFromCode(110)
Parameters:
{String} keyCode
Key code to convert
Since:
2.4
Returns:
{Number} The character corresponding to the key code

getColor()
Gets the color of the future draw lines and text in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getColor()
Since:
3.0

{Number} getCosine(angle)
Returns the cosine of an angle
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getCosine(90)
Parameters:
{Number} angle
Angle
Since:
1.0
Returns:
{Number} Cosine of an angle

{Number} getDay()
Returns the current day of the month
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getDay()
Since:
2.4
Returns:
{Number} Current day of the month

getFont()
Gets the font name of the future text in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getFont()
Since:
3.0

{Number} getHours()
Returns the current hour
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getHours()
Since:
2.4
Returns:
{Number} Current hour

{Number} getInputPosition()
Returns the current input position
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getInputPosition()
Since:
2.3
Returns:
{Number} The index position of the input chain

getItalic()
Gets whether the future text will be italic in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getItalic()
Since:
3.0

{String|Boolean} getKeyboardKey()
Returns the value of the key that is being pressed in the keyboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getKeyboardKey()
Since:
2.4
Returns:
{String|Boolean} Value of the key being pressed, false if none is being pressed

{String|Boolean} getKeyboardLastKey()
Returns the value of the last key in the keyboard that was being pressed and marks it as processed so the next call to getKeyboardLastKey() doesn't give it again
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getKeyboardLastKey()
Since:
2.4
Returns:
{String|Boolean} Value of the last key that was pressed, false if none has been pressed yet

{Boolean} getKeyboardPressed()
Checks if a key in the keyboard is being pressed
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getKeyboardPressed()
Since:
2.4
Returns:
{Boolean} Whether a key os being pressed or not

{String|Number, Boolean} getLayerExists(layerId)
Returns whether the layer exists
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getLayerExists("character")
Parameters:
layerId
Since:
2.4
Returns:
{String|Number} layerId Layer id of the layer to check
{Boolean} Whether a layer with the provided id exists

{Number} getLayerHeight()
Returns the height of the layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getLayerHeight()
Since:
1.0
Returns:
{Number} Height of the layer

{String} getLayerImage(id)
Returns as a value the image visible in the specified layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getLayerImage(2)
Parameters:
{Number|String} id Optional
Layer id
Since:
1.0
Returns:
{String} Image in the specified layer

{String} getLayerName(id)
Returns the layer name
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getLayerName(2)
Parameters:
{Number} id Optional
Layer id
Since:
1.0
Returns:
{String} Layer name

{Boolean} getLayerVisibility(id)
Returns if the specified layer is visible or hidden
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getLayerVisibility(2)
Parameters:
{Number|String} id Optional
Layer id
Since:
1.0
Returns:
{Boolean} Whether the specified layer is visible or hidden

{Number} getLayerWidth()
Returns the width of the layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getLayerWidth()
Since:
1.0
Returns:
{Number} Width of the layer

{Number} getMilliseconds()
Returns the current millisecond within the current second in time
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getMilliseconds()
Since:
2.4
Returns:
{Number} Current milliseconds in the current second

{Number} getMinutes()
Returns the current minute
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getMinutes()
Since:
2.4
Returns:
{Number} Current minute

{Number} getMonth()
Returns the current month
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getMonth()
Since:
2.4
Returns:
{Number} Current month

{String} getPixelColor(x, y, layer)
Returns the color in a certain coordinate in the current layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPixelColor(100,100)
Parameters:
{Number} x
Coordinate x of the position to check the color
{Number} y
Coordinate y of the position to check the color
{Number|String} layer Optional
Id of the layer to affect
Since:
2.4
Returns:
{String} Color in the specified position

{Number|Boolean} getPointerLastX()
Returns the horitzontal position of the pointer the last time it was clicked (mouse or touch gesture) in the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPointerLastX()
Since:
2.4
Returns:
{Number|Boolean} Horitzontal position of the pointer in the whiteboard, false if its not in the whiteboard

{Number|Boolean} getPointerLastY()
Returns the vertical position of the pointer the last time it was clicked (mouse or touch gesture) in the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPointerLastY()
Since:
2.4
Returns:
{Number|Boolean} Vertical position of the pointer in the whiteboard, false if its not in the whiteboard

{Boolean} getPointerOver()
Checks whether the pointer (mouse or touch gesture) is over the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPointerOver()
Since:
2.4
Returns:
{Boolean} Whether the pointer is over the whiteboard or not

{Boolean} getPointerPressed()
Checks whether the pointer (mouse or touch panel) is being pressed (click if its a mouse, touch if its a tocuh device)
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPointerPressed()
Since:
2.4
Returns:
{Boolean} Whether the pointer is being pressed

{Number|Boolean} getPointerX()
Returns the horitzontal position of the pointer (mouse or touch gesture) in the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPointerX()
Since:
2.4
Returns:
{Number|Boolean} Horitzontal position of the pointer in the whiteboard, false if its not in the whiteboard

{Number|Boolean} getPointerY()
Returns the vertical position of the pointer (mouse or touch gesture) in the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getPointerY()
Since:
2.4
Returns:
{Number|Boolean} Vertical position of the pointer in the whiteboard, false if its not in the whiteboard

{String} getRandomColor()
Returns a random color
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getRandomColor()
Since:
1.0
Returns:
{String} A random color

{Number} getRandomNumber(upperbound)
Returns a positive random integer number
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getRandomNumber(100)
Parameters:
{Number} upperbound Optional
The highest number desired, excluding this number
Number.MAX_VALUE
Since:
1.0
Throws:
codeError
Returns:
{Number} A positive random integer number [0,upperbound-1]

{String} getRGB(red, green, blue)
Returns a color from RGB components
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getRGB(0,128,256)
Parameters:
{Number} red
Red component in the range [0,255]
{Number} green
Green component in the range [0,255]
{Number} blue
Blue component in the range [0,255]
Since:
1.0
Returns:
{String} Color

{Number} getSeconds()
Returns the current second
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getSeconds()
Since:
2.4
Returns:
{Number} Current second

{Number} getSine(angle)
Returns the sine of an angle
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getSine(90)
Parameters:
{Number} angle
Angle
Since:
1.0
Returns:
{Number} Sine of an angle

getSize()
Gets the size of the future draw lines and text in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getSize()
Since:
3.0

{Number} getSquareRoot(number)
Returns the square root of the number
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getSquareRoot(9)
Parameters:
{Number} number
Number
Since:
1.0
Returns:
{Number} Square root of the number

{Number} getTangent(angle)
Returns the tangent of an angle
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getTangent(90)
Parameters:
{Number} angle
Angle
Since:
1.0
Returns:
{Number} Tangent of an angle

{Number} getTimestamp()
Returns a timestamp of the current hour
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getTimestamp()
Since:
2.4
Returns:
{Number} Timestamp of the current hour, in Epoch format (milliseconds since 1970/01/01)

{Number} getWeekDay()
Returns the current day of the week
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getWeekDay()
Since:
2.4
Returns:
{Number} Current day of the week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday

{Number} getX(id)
Returns the layer's guide's position's X coordinate
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getX()
Parameters:
{Number|String} id Optional
Layer id
Since:
1.0
Returns:
{Number} The layer's guide's position's X coordinate

{Number} getY(id)
Returns the layer's guide's position's Y coordinate
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getY()
Parameters:
{Number|String} id Optional
Layer id
Since:
1.0
Returns:
{Number} The layer's guide's position's Y coordinate

{Number} getYear()
Returns the current year
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
getYear()
Since:
2.4
Returns:
{Number} Current year

goTo(posx, posy)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
posx
posy

goToCenter()

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.

goToLowLeft()

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.

goToLowRight()

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.

goToUpLeft()

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.

goToUpRight()

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.

hide(id, hide)
Hides a layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
hide(2)
Parameters:
{Number|String} id
Layer id
{Boolean} hide Optional, Default: true
Whether to hide the layer or not
Since:
1.0

image(src, posx, posy, centered, width, height, rotation, flipX, flipY)
Puts an image in the specified position of the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
image(getLayerImage(3), 50, 50, true, 200, 150)
Parameters:
{String} src
image source. Can be an external http:// image or an image from getLayerImage()
{Number} posx
X coordinate where the image will be placed
{Number} posy
Y coordinate where the image will be placed
{Boolean} centered Optional
Whether or not the image should be centered in the given position
{Number} width Optional
Image width
{Number} height Optional
Image height
{Number} rotation Optional
Degrees to rotate the image
{Boolean} flipX Optional
Flip the image horizontally
{Boolean} flipY Optional
Flip the image vertically
Since:
1.0
Throws:
codeError

input(type)
Reads from the input area
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
input("line")
Parameters:
{String} type Optional, Default: "guess"
How to read the input. Possible values: "char", "word", "number", "integer", "line", "guess"
Since:
2.3
Throws:
codeError

inputReset(position)
Sets the position of the input pointer to a fixed place
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
inputReset(10)
Parameters:
{Number} position Optional, Default: 0
Position to go to
Since:
2.3

line(destinationx, destinationy)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
destinationx
destinationy

lineAt(originx, originy, destinationx, destinationy)
Draws a line from a coordinate to another using user coordinates
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
lineAt(200, 200, 50, 50)
Parameters:
{Number} originx
X coordinate where the line starts
{Number} originy
Y coordinate where the line starts
{Number} destinationx
X coordinate where the line ends
{Number} destinationy
Y coordinate where the line ends
Since:
1.0

output(text, newline)
Writes in the output area
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
output("Hello")
Parameters:
{String} text Optional, Default: ""
Static text that will be shown in the output section
{Boolean} newline Optional, Default: true
Whether or not there should be a carriage return
Since:
2.3

pop(id)
Deletes a layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
pop(3)
Parameters:
{String|Number} id Optional
Id of the layer to affect. By default, the top layer
Since:
2.3
Throws:
codeError

pull(levels, id)
Pulls a layer up in the layers order Upper layers overlap lower layers
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
pull(3)
Parameters:
{Number} levels Optional, Default: 1
Amount of steps to pull the layer up
{Number|String} id Optional
Id of the layer to affect
Since:
1.0
Throws:
codeError

push(levels, id)
Pushes a layer down in the layers order Upper layers overlap lower layers
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
push(3)
Parameters:
{Number} levels Optional, Default: 1
Amount of steps to push the layer down
{Number|String} id Optional
Id of the layer to affect
Since:
1.0
Throws:
codeError

say(message, timeout)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
message
timeout

setAxis(firstX, lastX, firstY, lastY)
Changes the axis of the whiteboard
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
setAxis(-200, 200, -200, 200);
Parameters:
{Number} firstX
First value in the horizontal axis (left)
{Number} lastX
Last value in the horizontal axis (right)
{Number} firstY
First value in the vertical axis (down)
{Number} lastY
Last value in the vertical axis (up)
Since:
2.1
Throws:
codeError

setBold(bold)
Sets the bold property in future text writes in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
setBold(true)
Parameters:
{Boolean} bold Optional, Default: true
Whether to use bold text
Since:
1.0

setColor(color)
Sets the color of the future draw lines and text in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
setColor("#FF0000")
Parameters:
{String} color
Color to use
Since:
1.0

setFont(font)
Sets the font to use in future text writes in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
setFont("Arial")
Parameters:
{String} font
Font to use
Since:
1.0

setItalic(italic)
Sets the italic property in future text writes in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
setItalic(true)
Parameters:
{Boolean} italic Optional, Default: true
Whether to use italic text
Since:
1.0

setSize(size)
Sets the size of the future draw lines and text in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
setSize(2)
Parameters:
{Number} size
Size in pixels
Since:
1.0

show(id, show)
Shows a layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
show(2)
Parameters:
{Number|String} id Optional
Layer id
{Boolean} show Optional, Default: true
Whether to show the layer or not
Since:
1.0

{Number} snapshot(id)
Creates a clone of the current layer in another layer, returns the layer name
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
snapshot()
Parameters:
{Number|String} id Optional
Layer id. If unset it creates it in a new layer
Since:
2.1
Throws:
codeError
Returns:
{Number} Layer name

sound(source, background, loop, audioHandlersIndex)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
source
background
loop
audioHandlersIndex

stop()
Stops the execution of any future code
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
stop()
Since:
1.0

stopSound(audioHandlersIndex)
Stop playing an audio file in the background
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
stopSound()
Parameters:
{Text} audioHandlersIndex
Handle id of the audio to stop, as returned by sound()
Since:
3.0

transparency(value, id)
Sets the layer transparency
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
transparency(0.5)
Parameters:
{Number} value
Transparency value in the range [0,1]
{Number|String} id Optional
Id of the layer to affect
Since:
2.2
Throws:
codeError

turnLeft(angle)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
angle

turnReset(angle)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
angle

turnRight(angle)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
angle

unanimate(timeoutHandlersIndex)
Stops an animation
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
unanimate(2)
Parameters:
{Number} timeoutHandlersIndex Optional
Animation handler to stop
Since:
2.0

unsetBold()
Unsets the bold property in future text writes in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
unsetBold()
Since:
1.0

unsetColor()
Sets the draw color to be transparent in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
unsetColor()
Since:
1.0

unsetFont()
Resets the font to use in future text writes in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
unsetFont()
Since:
1.0

unsetItalic()
Unsets the italic property in future text writes in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
unsetItalic()
Since:
1.0

unsetSize()
Resets the size of the future draw lines and text in the currently active layer
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
unsetSize()
Deprecated:
since version 2.3
Since:
1.0

{Number} use(id)
Switches the currently active layer, returns the layer name
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
use()
Parameters:
{Number|String} id Optional
Layer id. If unset it switches to a new layer
Since:
1.0
Returns:
{Number} Layer name

wait(milliseconds)

Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
Parameters:
milliseconds

windowButtonCreate(windowId, id, text, posx, posy, width, height, action)
Creates an existing window button
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowButtonCreate(1, "b2", "turn", 170, 90, "turnRight(15)")
Parameters:
{Number} windowId
Window id
{String} id
Button id
{String} text Optional
Text to show in the button
{Number} posx Optional
X coordinate to place the button in the window
{Number} posy Optional
Y coordinate to place the button in the window
{Number} width Optional
Width of the button
{Number} height Optional
Height of the button
{String|Function} action Optional
Code to run on button click
Since:
1.0

windowButtonEdit(id, text, posx, posy, width, height, action)
Edits an existing window button
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowButtonEdit("b2", "turn", 170, 90, "turnRight(15)")
Parameters:
{String} id
Button id
{String} text Optional
Text to show in the button
{Number} posx Optional
X coordinate to place the button in the window
{Number} posy Optional
Y coordinate to place the button in the window
{Number} width Optional
Width of the button
{Number} height Optional
Height of the button
{String|Function} action Optional
Code to run on button click
Since:
1.0

windowButtonHide(id)
Hides a window button
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowButtonHide("b1")
Parameters:
{String} id
Button id
Since:
1.0

windowButtonRemove(id)
Deletes a window button
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowButtonRemove("b1")
Parameters:
{String} id
Button id
Since:
1.0

windowButtonShow(id)
Shows a window button if it was hidden
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowButtonShow("b1")
Parameters:
{String} id
Button id
Since:
1.0

windowClean(id)
Removes all elements in a window
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowClean(2)
Parameters:
{Number} id
Window id
Since:
2.2

windowHide(id)
Hides the current window
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowHide(id)
Parameters:
{Number} id Optional
Window id
Since:
1.0

windowImageCreate(windowId, id, canvasId, posx, posy, width, height, onclick, onmouseover, onmouseout)
Creates a window embedded image
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowImageCreate(1, "img1", "3", 100, 100, 60, 15)
Parameters:
{Number} windowId
Window id
{String} id
Image id
{String|Number} canvasId
Layer id that will be used as image
{Number} posx Optional
X coordinate to place the image in the window
{Number} posy Optional
Y coordinate to place the image in the window
{Number} width Optional
Width to resize the image to
{Number} height Optional
height to resize the image to
{String|Function} onclick Optional
Code to run when the image is clicked
{String|Function} onmouseover Optional
Code to run when the mouse is over the image
{String|Function} onmouseout Optional
Code to run when the mouse is moved away from being over the image
Since:
1.0

windowImageEdit(id, canvasId, posx, posy, width, height, onclick, onmouseover, onmouseout)
Edits an existing window embedded image
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowImageEdit("img1", "3", 100, 100, 60, 15)
Parameters:
{String} id
Image id
{String|Number} canvasId
Layer id that will be used as image
{Number} posx Optional
X coordinate to place the image in the window
{Number} posy Optional
Y coordinate to place the image in the window
{Number} width Optional
Width to resize the image to
{Number} height Optional
height to resize the image to
{String|Function} onclick Optional
Code to run when the image is clicked
{String|Function} onmouseover Optional
Code to run when the mouse is over the image
{String|Function} onmouseout Optional
Code to run when the mouse is moved away from being over the image
Since:
1.0

windowImageHide(id)
Hides a window image
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowImageHide("img1")
Parameters:
{String} id
Image id
Since:
1.0

windowImageRemove(id)
Deletes a window image
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowImageRemove("b1")
Parameters:
{String} id
Image id
Since:
1.0

windowImageShow(id)
Shows a window image if it was hidden
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowImageShow("img1")
Parameters:
{String} id
Image id
Since:
1.0

windowInputCreate(windowId, id, posx, posy, width, height, type)
Creates a window input box
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputCreate(1, "i1", 70, 75, 90, 15, "color")
Parameters:
{Number} windowId
Window id
{String} id
Input box id
{Number} posx Optional
X coordinate to place the input box in the window
{Number} posy Optional
Y coordinate to place the input box in the window
{Number} width Optional
Width of th input box (in pixels)
{Number} height Optional
Height of th input box (in pixels)
{String} type Optional
Type of input box (see HTML5 reference)
Since:
1.0

windowInputEdit(id, posx, posy, width, height, type)
Edits an existing window input box
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputEdit("i1", 70, 75, 90, 15, "color")
Parameters:
{String} id
Input box id
{Number} posx Optional
X coordinate to place the input box in the window
{Number} posy Optional
Y coordinate to place the input box in the window
{Number} width Optional
Width of th input box (in pixels)
{Number} height Optional
Height of th input box (in pixels)
{String} type Optional
Type of input box (see HTML5 reference)
Since:
1.0

{String} windowInputGet(id)
Returns the value in the window input box
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputGet("i1")
Parameters:
{String} id
Input box id
Since:
1.0
Returns:
{String} Value in the window input box

windowInputHide(id)
Hides a window input box
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputHide("i1")
Parameters:
{String} id
Input box id
Since:
1.0

windowInputRemove(id)
Deletes a window input box
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputRemove("b1")
Parameters:
{String} id
Input box id
Since:
1.0

windowInputSet(id, value)
Edits an existing window input box
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputSet("secret", "")
Parameters:
{String} id
Input box id
{String} value
Value to set in the input box
Since:
1.0

windowInputShow(id)
Shows a window input box if it was hidden
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowInputShow("i1")
Parameters:
{String} id
Input box id
Since:
1.0

windowShow(id)
Shows the current window
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowShow()
Parameters:
{Number} id Optional
Window id
Since:
1.0

windowTextCreate(windowId, id, text, posx, posy, width, bold, italic, size, color, family)
Creates a window static text
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowTextCreate(1, "t2", "Repeticions:", 10, 100, undefined, true)
Parameters:
{Number} windowId
Window id
{String} id
Static text id
{String} text Optional
Text to show
{Number} posx Optional
X coordinate to place the static text in the window
{Number} posy Optional
Y coordinate to place the static text in the window
{Number} width Optional
Maximum width of the static text (will wrap below if it doesn't fit)
{Boolean} bold Optional
Set bold shape to the static text font
{Boolean} italic Optional
Set italic shape to the static text font
{Number} size Optional
Size of the font to apply to the static text
{String} color Optional
Color to apply to the static text
{String} family Optional
Font family to apply to the static text
Since:
1.0

windowTextEdit(id, text, posx, posy, width, bold, italic, size, color, family)
Edits an existing window static text
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowTextCreate("t2", "Repeticions:", 10, 100, undefined, true)
Parameters:
{String} id
Static text id
{String} text Optional
Text to show
{Number} posx Optional
X coordinate to place the static text in the window
{Number} posy Optional
Y coordinate to place the static text in the window
{Number} width Optional
Maximum width of the static text (will wrap below if it doesn't fit)
{Boolean} bold Optional
Set bold shape to the static text font
{Boolean} italic Optional
Set italic shape to the static text font
{Number} size Optional
Size of the font to apply to the static text
{String} color Optional
Color to apply to the static text
{String} family Optional
Font family to apply to the static text
Since:
1.0

{String} windowTextGet(id)
Returns the text in the window static text
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowTextGet("t2")
Parameters:
{String} id
Static text id
Since:
1.0
Returns:
{String} Text in the window static text

windowTextHide(id)
Hides a window static text
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowTextHide("t1")
Parameters:
{String} id
Static text id
Since:
1.0

windowTextRemove(id)
Deletes a window static text
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowTextRemove("b1")
Parameters:
{String} id
Static text id
Since:
1.0

windowTextShow(id)
Shows a window static text if it was hidden
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowTextShow("t1")
Parameters:
{String} id
Static text id
Since:
1.0

windowUse(id)
Changes the active window
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
windowUse(2)
Parameters:
{Number} id Optional
Window id
Since:
1.0

write(text)
Writes text at guide's position
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
write("Hello!")
Parameters:
{String} text
Text to write
Since:
1.0

writeAt(text, posx, posy, angle)
Writes text at a specific position
Defined in: </tmp/tmp.fx2Xv6HGnf.js>.
writeAt("Hello!", 200, 200, 90)
Parameters:
{String} text
Text to write
{Number} posx
X coordinate to start writing
{Number} posy
Y coordinate to start writing
{Number} angle Optional, Default: 0
Angle in which to write
Since:
1.0