All Codes

Strings and Integers

Control Panel Items

GUI

Audio/Video

Event Handlers



GUI

Command:Timer
Codeskulptor:timer = simplegui.create_timer(500, timer_handler)
Codeskulptor:(later in script when readey to start)timer.start()
EzpzJs:TimerInterval(a, b, c, d)
EzpzJs Explainationa= TimerName, b = TimerVar, c = frequency, d = function to execute
EzPzJs Literal:TimerInterval("MyTimer", "TimerVar", 40, DrawHandler);
EzpzJs Notes:This command doesn't include a starter. Just use a condition when the time is right to start the timer. Also there is no draw handler. Just set your timer for frame frequency.


Command:Canvas
Codeskulptor:frame = simplegui.create_frame(Frame Name, Width, Height)
Codeskulptor Literal:frame = simplegui.create_frame('Testing', 100, 100)
Codeskulptor Later in Code:frame.start
CodeSkulptor Note:In Codeskulptor, calling a window (called frame) is creating a canvas
-------
EzpzJs:canvas(name, width, height);
EzpzJs Literal:canvas("myCanvas", 500, 500);
EzpzJs Note:There is no need to call a start to the frame or canvas, it appears in the first html window, but you must set a color to the frame or else your animations will look funky.


Command:Set Canvas Background
Codeskulptor:frame.set_canvas_background(color)
Codeskulptor Literal:frame.set_canvas_background('Red')
EzpzJs:canvasColor("myCanvas", "Green");


Command:Square on Canvas
Codeskulptor Explain:canvas.draw_polygon([[pos1], [pos2], [pos3], [pos4]], line_width, 'line color', 'fill color')
Codeskulptor Literal:canvas.draw_polygon([[90, 70], [80, 40], [70, 90], [70, 70]], 12, 'Yellow', 'Orange')
EzpzJs Explain:canvasQuad(name, color, pos1[0], pos1[1], pos2[0], pos2[1]);
EzpzJs Literal:canvasQuad("myCanvas", "Grey", 0, 0, 400, 400);
Notes:Codeskulptor can do triangles and quads in one command.


Command:Triangle On Canvas
EzpzJs Literal:canvasTriangle("myCanvas", "Red", XPos, YPos, 100, 100);
EzpzJs Explaination:canvasTriangle(Canvas Name, Color of triangle, x position, y position, length of base, height of triangle)


Command:Line on Canvas
Codeskulptor Explain:canvas.draw_line(point1, point2, line_width, line_color)
Codeskulptor Literal:canvas.draw_line((10, 20), (30, 40), 12, 'Red')
EzpzJs Explain:canvasLine(name, color, width, x1, y1, x2, y2)
EzpzJs Literal:canvasLine("myCanvas", "Green", 10, 0, 0, 500, 500);


Command:Draw a circle on canvas
Codeskulptor Explaination:canvas.draw_circle(center_point, radius, line_width, line_color, fill_color)
Codeskulptor Literal:canvas.draw_circle((50, 50), 20, 5, 'Blue', 'White')
EzpzJs Explaination:canvasCircle(name, radius, line color, fill color, line width, center x, center y);
EzpzJs Literal:canvasCircle("myCanvas", 80, "Orange", "Yellow", 8, 160, 300);


Command:Place a small point on canvas
Codeskulptor Explaination:canvas.draw_point(point, color)
Codeskulptor Literal:canvas.draw_point((10, 10), 'Green')
EzpzJs Explaination:canvasPoint(name, color, x1, y1);
EzpzJs Literal:canvasPoint("myCanvas", "Green", 250, 46);


Command:Draw text on canvas
Codeskulptor Explaination:canvas.draw_text(text, point, font_size, font_color, font_face)
Codeskulptor Literal:canvas.draw_text('C', (80, 50), 12, 'Gray', 'serif')
EzpzJs Explaination:canvasText(name, text, color, size, fontnumber, x, y);
EzpzJs Literal:canvasText("myCanvas", "Purple", "Purple", 35, 1, 225, 100);


Command:Load Image
Codeskulptor Explaination:simplegui.load_image(URL)
Codeskulptor Literal:image = simplegui.load_image('http://commondatastorage.googleapis.com/codeskulptor-assets/gutenberg.jpg')
EzpzJs Explaination:ImageLoad(image);
EzpzJs Literal:ImageLoad(image.png);


Command:Simple Image Drop
Codeskulptor:No Equivalent
EzpzJs Explaination:canvasSimpleImage(name, picturelocation, x placement, y placement);
EzpzJs LiteralcanvasSimpleImage("myCanvas", ww, 400, 350);


Command:Complex Image Placement
Codeskulptor Explaination:canvas.draw_image(image, center_source, width_height_source, center_dest, width_height_dest, rotation)
Codeskulptor Literal:canvas.draw_image(image, (1521 // 2, 1818 // 2), (1521, 1818), (40, 70), (100, 100), 2)
Codeskulptor Note:the last variable called rotation is optional
---------
EzpzJs Explaination:canvasComplexImage(name, picturelocaction, x center of source, y center of source, wid of clip, ht of clip, x placement, y place, wid of place, ht of place, roatation)
EzpzJs Literal:canvasComplexImage("myCanvas", yy, 36, 48, 72, 96, 36, 48, 72, 96, 0.5);
EzpzJs Note:Rotation is not optional; just mark 0 for normal.




Command:Load Sprites
EzpzJs Explaination:This calls in a special timer for handling sprites
EzpzJs Literal:SpriteStart();