-
Ellipse()
Examples
Ellipse(45, 45, 50, 80);
Description
Draws an ellipse (oval) to the screen. By default, the first two parameters set the location of the center of the ellipse, and the third and fourth parameters set the shape's width and height. If no height is specified, the value of width is used for both the width and height. You are not allowed to use negative values. An ellipse with equal width and height is a circle.
Syntax
Ellipse(x, y, w, [h])
Parameters
x positive number: x-coordinate of the center of the ellipse
y positive number: y-coordinate of the center of the ellipse
w positive number: width of the ellipse
h positive number: height of the ellipse (optional)
-
Circle()
Examples
Circle(45, 45, 50);
Description
Draws a circle to the screen. A circle is a simple closed shape. It is the set of all points in a plane that are at a given distance from a given point, the center. This function is a special case of the Ellipse() function, where the width and height of the ellipse are the same. Height and width of the ellipse correspond to the diameter of the circle. By default, the first two parameters set the location of the center of the circle, the third sets the diameter of the circle. You are not allowed to use negative values.
Syntax
Circle(x, y, d)
Parameters
x positive number: x-coordinate of the center of the circle
y positive number: y-coordinate of the center of the circle
d positive number: diameter of the center of the circle
-
Rect()
Examples
Rect(45, 45, 50, 65);
Description
Draws a rectangle on the canvas. A rectangle is a four-sided closed shape with every angle at ninety degrees. By default, the first two parameters set the location of the upper-left corner, the third sets the width, and the fourth sets the height. You are not allowed to use negative values.
Syntax
Rect(x, y, w, h)
Parameters
x positive number: x-coordinate of the upper left corner of the rectangle
y positive number: x-coordinate of the upper left corner of the rectangle
w positive number: width of the rectangle
h positive number: height of the rectangle
-
Square()
Examples
Square(45, 40.35, 50);
Description
Draws a square to the screen. A square is a four-sided shape with every angle at ninety degrees, and equal side size. This function is a special case of the Rect() function, where the width and height are the same, and the parameter is called "w" for width. By default, the first two parameters set the location of the upper-left corner, the third sets the side size of the square. You are not allowed to use negative values.
Syntax
Square(x, y, w)
Parameters
x positive number: x-coordinate of the upper left corner of the square
y positive number: x-coordinate of the upper left corner of the square
w positive number: width (and height) of the square
-
Line()
Examples
Line(40, 60, 80, 100);
Description
Draws a line (a direct path between two points) to the screen.
Syntax
Line(x1, y1, x2, y2)
Parameters
x1 positive number: x-coordinate of the first point of the line
y1 positive number: y-coordinate of the first point of the line
x2 positive number: x-coordinate of the second point of the line
y2 positive number: y-coordinate of the second point of the line
-
Triangle()
Examples
Triangle(20, 10, 80, 80, 100, 10);
Description
Draws a triangle to the canvas. A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the third point. You are not allowed to use negative values.
Syntax
Triangle(x1, y1, x2, y2, x3, y3)
Parameters
x1 positive number: x-coordinate of the first point of the triangle
y1 positive number: y-coordinate of the first point of the triangle
x2 positive number: x-coordinate of the second point of the triangle
y2 positive number: y-coordinate of the second point of the triangle
x3 positive number: x-coordinate of the third point of the triangle
y3 positive number: y-coordinate of the third point of the triangle
-
Image()
Examples
string path = @"http://mana-buch.de/149/cover.png";
Image(path);
path = @"C:\images\Logo.png";
Image(path, 5, 10);
Description
This function requires only three parameters: path, x, and y - where (x, y) is the position of the image.
Syntax
Image(path, [x], [y])
Parameters
path: string with the file path of the image you want to display or internet address
x (optional): positive number: x-coordinate of the first point of the image
y (optional): positive number: y-coordinate of the first point of the image
-
Point()
Examples
Point(20, 40);
Description
Draws a point, a coordinate in space at the dimension of one pixel. The first parameter is the horizontal value for the point, the second param is the vertical value for the point.
Syntax
Point(x, y)
Parameters
x positive number: x-coordinate of the point
y positive number: y-coordinate of the point
-
Arc()
Examples
Arc(100, 100, 200, 250, 50, 80, 45, true);
Description
This function draws an arc on the screen. The first two parameters define the starting point of the arc's ellipse, the third and fourth parameter define the end point of the arc's ellipse. By defining width and height you can form the arc. The angle rotation parameter allows you to tilt the whole arc. You can decide if the arc's ellipse should be drawn clockwise from the start to the end point or not by setting the rotation parameter either true or false.
Syntax
Arc(x1, y1, x2, y2, w, h, angle rotation, clockwise);
Parameters
x1 positive number: x-coordinate of the arc's ellipse start-point
y1 positive number: y-coordinate of the arc's ellipse start-point
x2 positive number: x-coordinate of the arc's ellipse end-point
y2 positive number: y-coordinate of the arc's ellipse end-point
w positive number: width of the arc's ellipse
h positive number: height of the arc's ellipse
angle rotation positive number: tilt of arc's ellipse
clockwise true/false: determines direction of rotation; true equals clockwise
-
Bezier()
Examples
Bezier(25, 20, 100, 180, 280, 12, 305, 350, true);
Description
Draws a cubic Bezier curve on the screen. These curves are defined by a series of anchor and control points. The first two parameters specify the anchor point. After that there are three control points defined, which the curve will running trough. The last parameter determines if there will be a line between the first and the last point or not.
Syntax
Bezier(xStart, yStart, x1, y1, x2, y2, x3, y3, isClosed)
Parameters
xStart positive number: x-coordinate of the Bezier curve's start-point
yStart positive number: y-coordinate of the Bezier curve's start-point
x1 positive number: x-coordinate of first point the Bezier curve is running through
y1 positive number: y-coordinate of first point the Bezier curve is running through
x2 positive number: x-coordinate of second point the Bezier curve is running through
y2 positive number: y-coordinate of second point the Bezier curve is running through
x3 positive number: x-coordinate of third point the Bezier curve is running through
y3 positive number: y-coordinate of third point the Bezier curve is running through
isClosed true/false: determines whether start and last point are connected or not
-
Text()
Examples
Text("Test", 25, 30, 20, 30);
Description
Draws text to the screen. Displays the information specified in the first parameter in the screen in the position specified by the x and y parameters. The size of the text field can be influenced by the optional parameters w and h.
Syntax
Text(text, x, y, [w], [h])
Parameters
text Text that is going to be displayed
x positive number: x-coordinate of the upper left corner of the text field
y positive number: y-coordinate of the upper left corner of the text field
w positive number: width of the text field; influences text alignment (optional)
h positive number: height of the text field (optional)