Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (57 sloc) 4.08 KB
tdk.message(title, message), tdk.info(title, message), tdk.popup(title, message):
This will display a popup message suitable for giving the user information.
tdk.alert(title, message), tdk.warning(title, message), tdk.error(title, message):
This will display a popup message suitable for present an alert, warning, or reporting an error
to the user
tdk.accessDenied(title, message), tdk.bad(title, message), tdk.noaccess(title, message):
This will display a popup message suitable for present the user with a access denied message,
or a no access message. This is best for restricting access to the user.
animate:
This is a function the user should define. If defined it will be called repeatedly at a rate
suitable for the user's browser. This should only be used for animation with the TDK canvas,
for other repeated actions, use tdk.interval. Please note that this function will clear the
canvas every time so you must repeatedly draw items to the TDK canvas. This requires the TDK
canvas to be initialized(see: tdk.init())
tdk.interval(function(){}, seconds), tdk.interval(function(){}):
This will do a specific task(an anonymous function, first parameter) every amount of
seconds(number, second parameter). If only the task(an anonymous function, first parameter) is passed
then the task will be called repeatedly at a rate suitable for the user's browser.
tdk.setColor(name):
This will change what the color is of the objects being draw to the TDK canvas. The TDK canvas
must be initialized(see: tdk.init());
tdk.outline(width):
This will draw only the outline of all future shapes unless otherwise specified(see:
tdk.fill()). The width parameter will determine how thick the outlines should be.
tdk.fill():
This will draw the entire of all future shapes unless otherwise specified(see: tdk.outline())
tdk.rect(x, y, width, height):
This will draw a rectangle on the TDK canvas. The first parameter is the x coordinate. The x
coordinate should be between 0-100, 0 being center and 100 being fully right. The second
parameter is the y coordinate. The y coordinate should be between 0-100, 0 being center
and 100 being fully bottom. The third parameter is the width. The width should be between
0-100, 0 being nothing and 100 being edge to edge. The fourth parameter is the height. The
height should be between 0-100, 0 being nothing and 100 being edge to edge. The TDK canvas
must be initialized(see: tdk.init());
tdk.circle(x, y, radius):
This will draw a circle on the TDK canvas. The first parameter is the x coordinate. The x
coordinate should be between 0-100, 0 being center and 100 being fully right. The second
parameter is the y coordinate. The y coordinate should be between 0-100, 0 being center
and 100 being fully bottom. The third parameter is the radius. The radius should be between
0-100, 0 being nothing and 100 being edge to edge. The TDK canvas must be initialized(see:
tdk.init());
tdk.shape(points):
This will draw an irregular shape. The only parameter is an array of points. The array passed
into the function should consist of arrays. Each array inside the array should represent a
point. For example drawing a triangle may look like this:
tdk.shape([ [-20, -20], [-20, 20], [20, 0] ])
tdk.line(point1, point2, lineWid):
This will draw a line. The first parameter should be an array representing the first/starting
point. The second parameter should be an array representing the second/ending point. The last
parameter should be the line width. For example a strait line may look like this:
tdk.line([-20, 0], [20, 0], 5)
tdk.image(x, y, url):
This will draw a image on the TDK canvas. The first parameter is the x coordinate. The x
coordinate should be between 0-100, 0 being center and 100 being fully right. The second
parameter is the y coordinate. The y coordinate should be between 0-100, 0 being center
and 100 being fully bottom. The third parameter is the URL of the image you want to
display in a String.
You can’t perform that action at this time.