scrbtle

Reference

Graphic

  • circle(x, y, radius)
    Draws a circle at location (x, y) with a radius of radius.
  • ellipse(x, y, width, height)
    Draws an ellipse at location (x, y) with a width of width and a height of height.
  • fillStyle(color, transparency)
    Changes the fill color and transparency of shapes. Transparency goes from 0 to 100.
  • line(x1, y1, x2, y2)
    Draws a line from location (x1, y1) to location (x2, y2).
  • lineStyle(color, thickness, transparency)
    Changes the appearance of lines and outlines of shapes. Transparency goes from 0 to 100.
  • rect(x, y, width, height)
    Draws a rectangle at location (x, y) with a width of width and a height of height.

Math

  • abs(value)
    Returns the absolut (non negative) value .
  • acos(value)
    Returns the arc cosine for the given value, in radians.
  • asin(value)
    Returns the arc sine for the given value, in radians.
  • atan(value)
    Returns the arc tangent for the given value, in radians.
  • cos(angleRadians)
    Returns the cosine for the given angle in radians.
  • max(value1, value2)
    Returns the larger value of the given parameters.
  • min(value1, value2)
    Returns the smaller value of the given parameters.
  • round(value)
    Returns the rounded value of the given parameter.
  • sin(angleRadians)
    Returns the sine for the given angle in radians.
  • tan(angleRadians)
    Returns the tangent for the given angle in radians.

Misc

  • random(min, max)
    Returns a random Number between min and max.
  • randomColor(usePool)
    Returns a random color. If usePool is set to true the color pool will be used. If it is set to false a random RGB color will be chosen.
  • rotateAround(angle, x, y)
    Rotates the canvas with the given angle (0-360) around the location x, y.
  • setDrag(drag)
    Chosse a value between 0 and 100. Higher values make the pen follow the cursor smoother.

Variables

  • backgroundcolor
    The current background color of the canvas.
  • counter
    The counter variable is 0 when you start to draw and increases while you’re drawing. Good choice for animation purposes.
  • currentX
    The x coordinate of the pen position.
  • currentY
    The y coordinate of the pen position.
  • distX
    The distance between the last and the current pen position on the x-axis.
  • distY
    The distance between the last and the current pen position on the y-axis.
  • distance
    The distance between the last and the current pen position.
  • height
    The height of the canvas.
  • oldX
    The x coordinate of the pen position in the last frame.
  • oldY
    The y coordinate of the pen position in the last frame.
  • width
    The width of the canvas.

Colors

  • BEIGE: 0xF5F5DC
  • BLACK: 0x000000
  • BLUE: 0x0000FF
  • BROWN: 0xA52A2A
  • CYAN: 0x00FFFF
  • GREEN: 0x00FF0
  • GREY: 0x7D7D7D
  • INDIGO: 0x4B0082
  • KHAKI: 0xF0E68C
  • MAGENTA: 0xFF00FF
  • MAROON: 0x800000
  • ORANGE: 0xFFA500
  • OLIVE: 0x808000
  • PINK: 0xFFC0CB
  • PURPLE: 0x800080
  • RED: 0xFF0000
  • STEELBLUE: 0x4682B4
  • SILVER: 0xC0C0C0
  • TEAL: 0x008080
  • TURQUOISE: 0x40E0D0
  • VIOLET: 0x662D91
  • YELLOW: 0xFFFF00
  • WHITE: 0xFFFFFF

circle(x, y, radius)