├── .gitignore ├── doc ├── examples │ ├── making-things-move │ │ ├── chap19 │ │ │ ├── assets │ │ │ │ ├── boing.mp3 │ │ │ │ ├── boing.ogg │ │ │ │ └── boing.wav │ │ │ ├── classes │ │ │ │ └── Ball.js │ │ │ ├── 10-timer_1.html │ │ │ ├── 11-timer_2.html │ │ │ ├── 03-random_1.html │ │ │ ├── 04-random_2.html │ │ │ ├── 07-random_5.html │ │ │ ├── 08-random_6.html │ │ │ ├── 05-random_3.html │ │ │ ├── 06-random_4.html │ │ │ ├── 09-random_7.html │ │ │ ├── 01-brownian_1.html │ │ │ └── 12-time_based_1.html │ │ ├── chap03 │ │ │ ├── classes │ │ │ │ ├── Ball.js │ │ │ │ └── Arrow.js │ │ │ ├── 02-up_down_motion.html │ │ │ ├── 01-rotate_arrow.html │ │ │ ├── 03-linear_vertical_motion.html │ │ │ ├── 04-pulsing_motion.html │ │ │ ├── 07-circular_movement.html │ │ │ ├── 08-elliptical_movement.html │ │ │ ├── 05-waves_with_two_angles.html │ │ │ ├── 06-waves_with_drawing.html │ │ │ ├── 09-distance_between_points.html │ │ │ └── 10-mouse_distance.html │ │ ├── chap05 │ │ │ ├── classes │ │ │ │ ├── Ball.js │ │ │ │ ├── Arrow.js │ │ │ │ └── Ship.js │ │ │ ├── 01-velocity_one_axis.html │ │ │ ├── 02-velocity_two_axes.html │ │ │ ├── 05-rotational_velocity.html │ │ │ ├── 06-acceleration_1.html │ │ │ ├── 03-velocity_angle.html │ │ │ ├── 04-follow_mouse_1.html │ │ │ ├── 10-follow_mouse_2.html │ │ │ ├── 07-acceleration_2.html │ │ │ ├── 08-acceleration_3.html │ │ │ ├── 09-gravity_acceleration.html │ │ │ └── 11-spaceship.html │ │ ├── chap06 │ │ │ ├── classes │ │ │ │ ├── Ball.js │ │ │ │ └── Ship.js │ │ │ ├── 07-friction_2.html │ │ │ ├── 06-friction_1.html │ │ │ ├── 04-bouncing_1.html │ │ │ ├── 05-bouncing_2.html │ │ │ ├── 02-fountain.html │ │ │ └── 01-boundary_remove_object.html │ │ ├── chap07 │ │ │ ├── classes │ │ │ │ └── Ball.js │ │ │ ├── 02-mouse_drag.html │ │ │ └── 01-mouse_events.html │ │ ├── chap08 │ │ │ ├── classes │ │ │ │ └── Ball.js │ │ │ ├── 04-ease_to_mouse.html │ │ │ ├── 05-spring_1.html │ │ │ ├── 01-easing_1.html │ │ │ ├── 06-spring_2.html │ │ │ ├── 08-spring_4.html │ │ │ ├── 03-easing_off.html │ │ │ ├── 07-spring_3.html │ │ │ ├── 09-spring_5.html │ │ │ ├── 13-offset_spring.html │ │ │ ├── 02-easing_2.html │ │ │ └── 10-chaining_springs_1.html │ │ ├── chap09 │ │ │ ├── classes │ │ │ │ ├── Ball.js │ │ │ │ └── Box.js │ │ │ ├── 03-point_hit_test.html │ │ │ ├── 01-object_hit_test.html │ │ │ ├── 04-distance_collision_1.html │ │ │ ├── 05-distance_collision_2.html │ │ │ └── 02-boxes_hit_test.html │ │ ├── chap10 │ │ │ ├── classes │ │ │ │ └── Ball.js │ │ │ ├── 01-rotation_1.html │ │ │ ├── 02-rotation_2.html │ │ │ └── 03-rotation_3.html │ │ ├── chap11 │ │ │ ├── classes │ │ │ │ └── Ball.js │ │ │ ├── 02-billiard_2.html │ │ │ └── 01-billiard_1.html │ │ ├── chap12 │ │ │ └── classes │ │ │ │ └── Ball.js │ │ ├── chap14 │ │ │ ├── classes │ │ │ │ ├── Ball.js │ │ │ │ └── Segment.js │ │ │ ├── 01-one_segment.html │ │ │ ├── 02-one_segment_drag.html │ │ │ ├── 03-two_segment_drag.html │ │ │ ├── 04-multi_segment_drag.html │ │ │ ├── 08-cosines_1.html │ │ │ ├── 09-cosines_2.html │ │ │ └── 05-two_segment_reach.html │ │ ├── chap15 │ │ │ ├── classes │ │ │ │ ├── Ball.js │ │ │ │ ├── Tree.js │ │ │ │ └── Ball3D.js │ │ │ ├── 01-perspective_1.html │ │ │ ├── 02-perspective_2.html │ │ │ └── 10-easing_3d.html │ │ ├── chap17 │ │ │ └── classes │ │ │ │ ├── Light.js │ │ │ │ └── Point3D.js │ │ ├── chap16 │ │ │ ├── classes │ │ │ │ ├── Ball3D.js │ │ │ │ ├── Triangle.js │ │ │ │ └── Point3D.js │ │ │ ├── 02-lines_3d_2.html │ │ │ └── 03-square_3d.html │ │ ├── chap18 │ │ │ ├── classes │ │ │ │ └── Ball3D.js │ │ │ ├── 03-skew_x.html │ │ │ ├── 02-matrix_rotate.html │ │ │ └── 04-skew_xy.html │ │ ├── chap13 │ │ │ ├── classes │ │ │ │ └── Segment.js │ │ │ ├── 01-segment.html │ │ │ ├── 02-single_segment.html │ │ │ ├── 05-walking_1.html │ │ │ ├── 06-walking_2.html │ │ │ ├── 03-two_segments_1.html │ │ │ ├── 04-two_segments_2.html │ │ │ ├── 07-walking_3.html │ │ │ └── 08-walking_4.html │ │ └── chap02 │ │ │ ├── 06-keyboard_events.html │ │ │ ├── 02-ball.html │ │ │ ├── 03-reparenting.html │ │ │ ├── 07-key_codes.html │ │ │ ├── 04-reparenting_classes.html │ │ │ ├── 05-mouse_events.html │ │ │ └── 01-event_sprite.html │ └── hello-world.html ├── notes │ └── class-hierarchy.txt └── api │ ├── style │ └── reset.css │ ├── fontvariant.html │ └── gradienttype.html ├── src ├── utils │ └── compat │ │ └── es5.js ├── primitives │ └── constants │ │ ├── fontvariant.js │ │ ├── fontstyle.js │ │ ├── fontweight.js │ │ └── textalign.js └── constants │ ├── gradienttype.js │ ├── linecap.js │ ├── linejoin.js │ └── pattern.js └── BSD-LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | build/*.tmp 2 | build/*.error 3 | build/*.jar 4 | src/TAGS 5 | doc/demos/tmp/ 6 | doc/notes/tmp/ 7 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/assets/boing.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lamberta/doodle-js/HEAD/doc/examples/making-things-move/chap19/assets/boing.mp3 -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/assets/boing.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lamberta/doodle-js/HEAD/doc/examples/making-things-move/chap19/assets/boing.ogg -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/assets/boing.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lamberta/doodle-js/HEAD/doc/examples/making-things-move/chap19/assets/boing.wav -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = color || "#ff0000"; 4 | return doodle.createSprite(function () { 5 | this.graphics.beginFill(color); 6 | this.graphics.circle(0, 0, radius); 7 | this.graphics.endFill(); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = color || "#ff0000"; 4 | return doodle.createSprite(function () { 5 | this.graphics.beginFill(color); 6 | this.graphics.circle(0, 0, radius); 7 | this.graphics.endFill(); 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | 8 | this.graphics.beginFill(color); 9 | this.graphics.circle(0, 0, this.radius); 10 | this.graphics.endFill(); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap07/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | 8 | this.graphics.beginFill(color); 9 | this.graphics.circle(0, 0, this.radius); 10 | this.graphics.endFill(); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | 8 | this.graphics.beginFill(color); 9 | this.graphics.circle(0, 0, this.radius); 10 | this.graphics.endFill(); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | 8 | this.graphics.beginFill(color); 9 | this.graphics.circle(0, 0, this.radius); 10 | this.graphics.endFill(); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap10/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | 8 | this.graphics.beginFill(color); 9 | this.graphics.circle(0, 0, this.radius); 10 | this.graphics.endFill(); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /src/utils/compat/es5.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /* ES5 compatibility 4 | */ 5 | if (typeof Function.prototype.bind !== 'function') { 6 | Function.prototype.bind = function (thisArg /*, args...*/) { 7 | var fn = this; 8 | return function () { 9 | return fn.apply(thisArg, arguments); 10 | }; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap11/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | this.mass = 1; 8 | 9 | this.graphics.beginFill(color); 10 | this.graphics.circle(0, 0, this.radius); 11 | this.graphics.endFill(); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap12/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | color = color || "#ff0000"; 3 | return doodle.createSprite(function () { 4 | this.vx = 0; 5 | this.vy = 0; 6 | this.radius = (radius === undefined) ? 40 : radius; 7 | this.mass = 1; 8 | 9 | this.graphics.beginFill(color); 10 | this.graphics.circle(0, 0, this.radius); 11 | this.graphics.endFill(); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/classes/Box.js: -------------------------------------------------------------------------------- 1 | function createBox (width, height, color) { 2 | width = (width === undefined) ? 50 : width; 3 | height = (height === undefined) ? 50 : height; 4 | color = color || "#ff0000"; 5 | return doodle.createSprite(function () { 6 | this.vx = 0; 7 | this.vy = 0; 8 | 9 | this.graphics.beginFill(color); 10 | this.graphics.rect(-width/2, -height/2, width, height); 11 | this.graphics.endFill(); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = (color === undefined) ? "#ff0000" : color; 4 | return doodle.createSprite(function () { 5 | this.radius = radius; 6 | this.vx = 0; 7 | this.vy = 0; 8 | this.mass = 1; 9 | 10 | this.graphics.beginFill(color); 11 | this.graphics.circle(0, 0, radius); 12 | this.graphics.endFill(); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap15/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = (color === undefined) ? "#ff0000" : color; 4 | return doodle.createSprite(function () { 5 | this.radius = radius; 6 | this.vx = 0; 7 | this.vy = 0; 8 | this.mass = 1; 9 | 10 | this.graphics.beginFill(color); 11 | this.graphics.circle(0, 0, radius); 12 | this.graphics.endFill(); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/classes/Ball.js: -------------------------------------------------------------------------------- 1 | function createBall (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = (color === undefined) ? "#ff0000" : color; 4 | return doodle.createSprite(function () { 5 | this.radius = radius; 6 | this.vx = 0; 7 | this.vy = 0; 8 | this.mass = 1; 9 | 10 | this.graphics.beginFill(color); 11 | this.graphics.circle(0, 0, radius); 12 | this.graphics.endFill(); 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap17/classes/Light.js: -------------------------------------------------------------------------------- 1 | function createLight (x, y, z, brightness) { 2 | brightness = (brightness === undefined) ? 1 : brightness; 3 | 4 | return Object.defineProperties({ 5 | x: (x === undefined) ? -100 : x, 6 | y: (y === undefined) ? -100 : y, 7 | z: (z === undefined) ? -100 : z 8 | }, { 9 | 'brightness': { 10 | get: function () { return brightness; }, 11 | set: function (b) { 12 | brightness = Math.min(Math.max(b, 0), 1); 13 | } 14 | } 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap16/classes/Ball3D.js: -------------------------------------------------------------------------------- 1 | function createBall3D (radius, color) { 2 | color = (color === undefined) ? "#ff0000" : color; 3 | return doodle.createSprite(function () { 4 | this.radius = (radius === undefined) ? 40 : radius; 5 | this.xpos = 0; 6 | this.ypos = 0; 7 | this.zpos = 0; 8 | this.vx = 0; 9 | this.vy = 0; 10 | this.vz = 0; 11 | this.mass = 1; 12 | 13 | this.graphics.lineStyle(1); 14 | this.graphics.beginFill(color); 15 | this.graphics.circle(0, 0, this.radius); 16 | this.graphics.endFill(); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap16/classes/Triangle.js: -------------------------------------------------------------------------------- 1 | function createTriangle (a, b, c, color) { 2 | var pointA = a, 3 | pointB = b, 4 | pointC = c; 5 | return doodle.createSprite(function () { 6 | this.color = color; 7 | this.draw = function (g) { 8 | g.beginFill(this.color, 0.5); 9 | g.beginPath(); 10 | g.moveTo(pointA.screenX, pointA.screenY); 11 | g.lineTo(pointB.screenX, pointB.screenY); 12 | g.lineTo(pointC.screenX, pointC.screenY); 13 | g.lineTo(pointA.screenX, pointA.screenY); 14 | g.endFill(); 15 | }; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/classes/Arrow.js: -------------------------------------------------------------------------------- 1 | function createArrow () { 2 | return doodle.createSprite(function () { 3 | this.graphics.lineStyle(2, "#000000", 1); 4 | this.graphics.beginFill("#ffff00"); 5 | this.graphics.beginPath(); 6 | this.graphics.moveTo(-50, -25); 7 | this.graphics.lineTo(0, -25); 8 | this.graphics.lineTo(0, -50); 9 | this.graphics.lineTo(50, 0); 10 | this.graphics.lineTo(0, 50); 11 | this.graphics.lineTo(0, 25); 12 | this.graphics.lineTo(-50, 25); 13 | this.graphics.lineTo(-50, -25); 14 | this.graphics.closePath(); 15 | this.graphics.endFill(); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/classes/Arrow.js: -------------------------------------------------------------------------------- 1 | function createArrow () { 2 | return doodle.createSprite(function () { 3 | this.graphics.lineStyle(2, "#000000", 1); 4 | this.graphics.beginFill("#ffff00"); 5 | this.graphics.beginPath(); 6 | this.graphics.moveTo(-50, -25); 7 | this.graphics.lineTo(0, -25); 8 | this.graphics.lineTo(0, -50); 9 | this.graphics.lineTo(50, 0); 10 | this.graphics.lineTo(0, 50); 11 | this.graphics.lineTo(0, 25); 12 | this.graphics.lineTo(-50, 25); 13 | this.graphics.lineTo(-50, -25); 14 | this.graphics.closePath(); 15 | this.graphics.endFill(); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap15/classes/Tree.js: -------------------------------------------------------------------------------- 1 | function createTree () { 2 | return doodle.createSprite(function () { 3 | this.xpos = 0; 4 | this.ypos = 0; 5 | this.zpos = 0; 6 | 7 | this.graphics.lineStyle(1, 0xffffff); 8 | this.graphics.beginPath(); 9 | this.graphics.lineTo(0, -140 - Math.random() * 20); 10 | this.graphics.moveTo(0, -30 - Math.random() * 30); 11 | this.graphics.lineTo(Math.random() * 80 - 40, 12 | -100 - Math.random() * 40); 13 | this.graphics.moveTo(0, -60 - Math.random() * 40); 14 | this.graphics.lineTo(Math.random() * 60 - 30, 15 | -110 - Math.random() * 20); 16 | this.graphics.stroke(); 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/classes/Ship.js: -------------------------------------------------------------------------------- 1 | function createShip () { 2 | return doodle.createSprite(function () { 3 | //method to call when key pressed 4 | this.draw = function (showFlame) { 5 | this.graphics.clear(); 6 | this.graphics.lineStyle(1, 0xffffff); 7 | this.graphics.beginPath(); 8 | this.graphics.moveTo(10, 0); 9 | this.graphics.lineTo(-10, 10); 10 | this.graphics.lineTo(-5, 0); 11 | this.graphics.lineTo(-10, -10); 12 | this.graphics.lineTo(10, 0); 13 | this.graphics.stroke(); 14 | 15 | if (showFlame) { 16 | this.graphics.beginPath(); 17 | this.graphics.moveTo(-7.5, -5); 18 | this.graphics.lineTo(-15, 0); 19 | this.graphics.lineTo(-7.5, 5); 20 | this.graphics.stroke(); 21 | } 22 | }; 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/classes/Ship.js: -------------------------------------------------------------------------------- 1 | function createShip () { 2 | return doodle.createSprite(function () { 3 | //method to call when key pressed 4 | this.draw = function (showFlame) { 5 | this.graphics.clear(); 6 | this.graphics.lineStyle(1, 0xffffff); 7 | this.graphics.beginPath(); 8 | this.graphics.moveTo(10, 0); 9 | this.graphics.lineTo(-10, 10); 10 | this.graphics.lineTo(-5, 0); 11 | this.graphics.lineTo(-10, -10); 12 | this.graphics.lineTo(10, 0); 13 | this.graphics.stroke(); 14 | 15 | if (showFlame) { 16 | this.graphics.beginPath(); 17 | this.graphics.moveTo(-7.5, -5); 18 | this.graphics.lineTo(-15, 0); 19 | this.graphics.lineTo(-7.5, 5); 20 | this.graphics.stroke(); 21 | } 22 | }; 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /doc/examples/hello-world.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Hello, World! 8 | 9 | 10 |
11 | 12 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/10-timer_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.502: Timer-Based Animation - Basic Timer 6 | 7 | 26 | 27 | 28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap15/classes/Ball3D.js: -------------------------------------------------------------------------------- 1 | function createBall3D (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = (color === undefined) ? "#ff0000" : color; 4 | return doodle.createSprite(function () { 5 | this.radius = radius; 6 | this.xpos = 0; 7 | this.ypos = 0; 8 | this.zpos = 0; 9 | this.vx = 0; 10 | this.vy = 0; 11 | this.vz = 0; 12 | this.mass = 1; 13 | 14 | this.graphics.lineStyle(1); 15 | this.graphics.beginFill(color); 16 | this.graphics.circle(0, 0, this.radius); 17 | this.graphics.endFill(); 18 | 19 | /* Just a temporary implementation to conform with the book demo. 20 | * Redraws circle using a new color value. 21 | */ 22 | this.color_transform = function (colorValue) { 23 | this.graphics.clear(); 24 | this.graphics.lineStyle(1); 25 | this.graphics.beginFill(colorValue); 26 | this.graphics.circle(0, 0, this.radius); 27 | this.graphics.endFill(); 28 | } 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap18/classes/Ball3D.js: -------------------------------------------------------------------------------- 1 | function createBall3D (radius, color) { 2 | radius = (radius === undefined) ? 40 : radius; 3 | color = (color === undefined) ? "#ff0000" : color; 4 | return doodle.createSprite(function () { 5 | this.radius = radius; 6 | this.xpos = 0; 7 | this.ypos = 0; 8 | this.zpos = 0; 9 | this.vx = 0; 10 | this.vy = 0; 11 | this.vz = 0; 12 | this.mass = 1; 13 | 14 | this.graphics.lineStyle(1); 15 | this.graphics.beginFill(color); 16 | this.graphics.circle(0, 0, this.radius); 17 | this.graphics.endFill(); 18 | 19 | /* Just a temporary implementation to conform with the book demo. 20 | * Redraws circle using a new color value. 21 | */ 22 | this.color_transform = function (colorValue) { 23 | this.graphics.clear(); 24 | this.graphics.lineStyle(1); 25 | this.graphics.beginFill(colorValue); 26 | this.graphics.circle(0, 0, this.radius); 27 | this.graphics.endFill(); 28 | } 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /src/primitives/constants/fontvariant.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.FontVariant 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'FontVariant', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name NORMAL 15 | * @return {string} [read-only] 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'NORMAL': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'normal' 25 | }, 26 | 27 | /** 28 | * @name SMALL_CAPS 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'SMALL_CAPS': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'small-caps' 39 | } 40 | }) 41 | }); 42 | -------------------------------------------------------------------------------- /doc/notes/class-hierarchy.txt: -------------------------------------------------------------------------------- 1 | # Doodle.js classes at a glance. 2 | 3 | #geometry 4 | doodle.geom 5 | - Point 6 | - Rect 7 | - Matrix 8 | 9 | #events 10 | doodle.events 11 | - Event 12 | - UIEvent => Event 13 | - MouseEvent => UIEvent => Event 14 | - TouchEvent => UIEvent => Event 15 | - TextEvent => UIEvent => Event 16 | - KeyboardEvent => UIEvent => Event 17 | 18 | #base classes 19 | doodle 20 | - EventDispatcher 21 | - Node => EventDispatcher 22 | - Sprite => Node => EventDispatcher 23 | - ElementNode => Node => EventDispatcher 24 | - Layer => ElementNode => Node => EventDispatcher 25 | - Display => ElementNode => Node => EventDispatcher 26 | - Graphics 27 | 28 | #primitives 29 | doodle 30 | - Image => Sprite => Node => EventDispatcher 31 | - Text => Sprite => Node => EventDispatcher 32 | 33 | #utility functions 34 | doodle.utils 35 | - types 36 | 37 | #constants 38 | doodle 39 | - FontStyle 40 | - FontVariant 41 | - FontWeight 42 | - TextAlign 43 | - TextBaseline 44 | - LineCap 45 | - LineJoin 46 | - GradientType 47 | - Pattern 48 | - Keyboard 49 | -------------------------------------------------------------------------------- /src/constants/gradienttype.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * The GradientType class provides values for the type parameter in the 5 | * beginGradientFill() and lineGradientStyle() methods of the Graphics class. 6 | * @name doodle.GradientType 7 | * @class 8 | * @static 9 | */ 10 | Object.defineProperty(doodle, 'GradientType', { 11 | enumerable: true, 12 | writable: false, 13 | configurable: false, 14 | value: Object.create(null, { 15 | /** 16 | * @name LINEAR 17 | * @return {string} [read-only] 18 | * @property 19 | * @constant 20 | * @static 21 | */ 22 | 'LINEAR': { 23 | enumerable: true, 24 | writable: false, 25 | configurable: false, 26 | value: 'linearGradient' 27 | }, 28 | 29 | /** 30 | * @name RADIAL 31 | * @return {string} [read-only] 32 | * @property 33 | * @constant 34 | * @static 35 | */ 36 | 'RADIAL': { 37 | enumerable: true, 38 | writable: false, 39 | configurable: false, 40 | value: 'radialGradient' 41 | } 42 | }) 43 | }); 44 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/classes/Segment.js: -------------------------------------------------------------------------------- 1 | function createSegment (segmentWidth, segmentHeight, color) { 2 | color = color || 0xffffff; 3 | return doodle.createSprite(function () { 4 | this.segmentWidth = segmentWidth; 5 | this.segmentHeight = segmentHeight; 6 | this.vx = 0; 7 | this.vy = 0; 8 | init.call(this); 9 | 10 | function init () { 11 | //draw the segment itself 12 | this.graphics.lineStyle(1); 13 | this.graphics.beginFill(color); 14 | this.graphics.roundRect(-segmentHeight / 2, 15 | -segmentHeight / 2, 16 | segmentWidth + segmentHeight, 17 | segmentHeight, 18 | segmentHeight / 2, 19 | segmentHeight / 2); 20 | this.graphics.endFill(); 21 | //draw the two "pins" 22 | this.graphics.circle(0, 0, 2); 23 | this.graphics.circle(segmentWidth, 0, 2); 24 | } 25 | 26 | this.getPin = function () { 27 | var angle = this.rotation * Math.PI / 180, 28 | xPos = this.x + Math.cos(angle) * segmentWidth, 29 | yPos = this.y + Math.sin(angle) * segmentWidth; 30 | return {x:xPos, y:yPos}; //point 31 | }; 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/classes/Segment.js: -------------------------------------------------------------------------------- 1 | function createSegment (segmentWidth, segmentHeight, color) { 2 | color = color || 0xffffff; 3 | return doodle.createSprite(function () { 4 | this.segmentWidth = segmentWidth; 5 | this.segmentHeight = segmentHeight; 6 | this.vx = 0; 7 | this.vy = 0; 8 | init.call(this); 9 | 10 | function init () { 11 | //draw the segment itself 12 | this.graphics.lineStyle(1); 13 | this.graphics.beginFill(color); 14 | this.graphics.roundRect(-segmentHeight / 2, 15 | -segmentHeight / 2, 16 | segmentWidth + segmentHeight, 17 | segmentHeight, 18 | segmentHeight / 2, 19 | segmentHeight / 2); 20 | this.graphics.endFill(); 21 | //draw the two "pins" 22 | this.graphics.circle(0, 0, 2); 23 | this.graphics.circle(segmentWidth, 0, 2); 24 | } 25 | 26 | this.getPin = function () { 27 | var angle = this.rotation * Math.PI / 180, 28 | xPos = this.x + Math.cos(angle) * segmentWidth, 29 | yPos = this.y + Math.sin(angle) * segmentWidth; 30 | return {x:xPos, y:yPos}; //point 31 | }; 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/06-keyboard_events.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.46: Keyboard Events 6 | 7 | 8 | 30 | 31 | 32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /src/constants/linecap.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.LineCap 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'LineCap', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name BUTT 15 | * @return {string} [read-only] Default 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'BUTT': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'butt' 25 | }, 26 | 27 | /** 28 | * @name ROUND 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'ROUND': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'round' 39 | }, 40 | 41 | /** 42 | * @name SQUARE 43 | * @return {string} [read-only] 44 | * @property 45 | * @constant 46 | * @static 47 | */ 48 | 'SQUARE': { 49 | enumerable: true, 50 | writable: false, 51 | configurable: false, 52 | value: 'square' 53 | } 54 | }) 55 | }); 56 | -------------------------------------------------------------------------------- /src/constants/linejoin.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.LineJoin 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'LineJoin', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name MITER 15 | * @return {string} [read-only] Default 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'MITER': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'miter' 25 | }, 26 | 27 | /** 28 | * @name ROUND 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'ROUND': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'round' 39 | }, 40 | 41 | /** 42 | * @name BEVEL 43 | * @return {string} [read-only] 44 | * @property 45 | * @constant 46 | * @static 47 | */ 48 | 'BEVEL': { 49 | enumerable: true, 50 | writable: false, 51 | configurable: false, 52 | value: 'bevel' 53 | } 54 | }) 55 | }); 56 | -------------------------------------------------------------------------------- /src/primitives/constants/fontstyle.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.FontStyle 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'FontStyle', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name NORMAL 15 | * @return {string} [read-only] 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'NORMAL': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'normal' 25 | }, 26 | 27 | /** 28 | * @name ITALIC 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'ITALIC': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'italic' 39 | }, 40 | 41 | /** 42 | * @name OBLIQUE 43 | * @return {string} [read-only] 44 | * @property 45 | * @constant 46 | * @static 47 | */ 48 | 'OBLIQUE': { 49 | enumerable: true, 50 | writable: false, 51 | configurable: false, 52 | value: 'oblique' 53 | } 54 | }) 55 | }); 56 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/11-timer_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.593: Timer-Based Animation 6 | 7 | 8 | 9 | 38 | 39 | 40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/01-velocity_one_axis.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.125: Velocity on One Axis 6 | 7 | 8 | 9 | 40 | 41 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/02-ball.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.37: Events for Animation 6 | 7 | 8 | 41 | 42 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/02-velocity_two_axes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.126: Velocity on Two Axes 6 | 7 | 8 | 9 | 42 | 43 | 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/05-rotational_velocity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.131: Velocity Extended 6 | 7 | 8 | 9 | 40 | 41 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/06-acceleration_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.133: Acceleration on One Axis 6 | 7 | 8 | 9 | 42 | 43 | 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/01-segment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.325: Show Segments 6 | 7 | 8 | 9 | 42 | 43 | 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/03-point_hit_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.9, p.230: Hit Testing a Sprite and Point 6 | 7 | 8 | 9 | 40 | 41 | 42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/03-random_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.492: Square Distribution 6 | 7 | 8 | 9 | 41 | 42 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /BSD-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Billy Lamberta, http://www.lamberta.org/ 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY BILLY LAMBERTA ''AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BILLY LAMBERTA BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/04-random_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.492: Square Distribution - Compact 6 | 7 | 8 | 9 | 41 | 42 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/02-up_down_motion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.68: Smooth Up and Down Motion 6 | 7 | 8 | 9 | 43 | 44 | 45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/04-ease_to_mouse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.198: A Moving Target 6 | 7 | 8 | 9 | 44 | 45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap10/01-rotation_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.10, p.250: Simple Coordinate Rotation 6 | 7 | 8 | 9 | 42 | 43 | 44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/01-rotate_arrow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.65: Rotation 6 | 7 | 8 | 9 | 41 | 42 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /src/constants/pattern.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.Pattern 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'Pattern', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name REPEAT 15 | * @return {string} [read-only] 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'REPEAT': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'repeat' 25 | }, 26 | 27 | /** 28 | * @name REPEAT_X 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'REPEAT_X': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'repeat-x' 39 | }, 40 | 41 | /** 42 | * @name REPEAT_Y 43 | * @return {string} [read-only] 44 | * @property 45 | * @constant 46 | * @static 47 | */ 48 | 'REPEAT_Y': { 49 | enumerable: true, 50 | writable: false, 51 | configurable: false, 52 | value: 'repeat-y' 53 | }, 54 | 55 | /** 56 | * @name NO_REPEAT 57 | * @return {string} [read-only] 58 | * @property 59 | * @constant 60 | * @static 61 | */ 62 | 'NO_REPEAT': { 63 | enumerable: true, 64 | writable: false, 65 | configurable: false, 66 | value: 'no-repeat' 67 | } 68 | }) 69 | }); 70 | -------------------------------------------------------------------------------- /src/primitives/constants/fontweight.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.FontWeight 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'FontWeight', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name NORMAL 15 | * @return {string} [read-only] 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'NORMAL': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'normal' 25 | }, 26 | 27 | /** 28 | * @name BOLD 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'BOLD': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'bold' 39 | }, 40 | 41 | /** 42 | * @name BOLDER 43 | * @return {string} [read-only] 44 | * @property 45 | * @constant 46 | * @static 47 | */ 48 | 'BOLDER': { 49 | enumerable: true, 50 | writable: false, 51 | configurable: false, 52 | value: 'bolder' 53 | }, 54 | 55 | /** 56 | * @name LIGHTER 57 | * @return {string} [read-only] 58 | * @property 59 | * @constant 60 | * @static 61 | */ 62 | 'LIGHTER': { 63 | enumerable: true, 64 | writable: false, 65 | configurable: false, 66 | value: 'lighter' 67 | } 68 | }) 69 | }); 70 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/05-spring_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.202: Springing in One Dimension 6 | 7 | 8 | 9 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/03-linear_vertical_motion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.69: Linear Vertical Motion 6 | 7 | 8 | 9 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/04-pulsing_motion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.70: Pulsing Motion 6 | 7 | 8 | 9 | 44 | 45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/03-velocity_angle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.128: Velocity Angle 6 | 7 | 8 | 9 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/07-random_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.497: Biased Distribution 6 | 7 | 8 | 9 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/07-circular_movement.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.73: Circular Movement 6 | 7 | 8 | 9 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/07-friction_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.6, p.167: Friction, the Easy Way 6 | 7 | 8 | 9 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/01-easing_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.193: Simple Easing 1 6 | 7 | 8 | 9 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/01-one_segment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.350: Reaching with a Single Segment 6 | 7 | 8 | 9 | 41 | 42 | 43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/01-object_hit_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.9, p.227: Hit Testing Two Sprites 6 | 7 | 8 | 9 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/08-elliptical_movement.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.74: Elliptical Movement 6 | 7 | 8 | 9 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/02-single_segment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.327: Moving One Segment 6 | 7 | 8 | 9 | 10 | 44 | 45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/06-spring_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.203: Springing in One Dimension with Friction 6 | 7 | 8 | 9 | 48 | 49 | 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap18/03-skew_x.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.18, p.482: The Matrix Class - Skew X 6 | 7 | 8 | 43 | 44 | 45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/04-follow_mouse_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.130: Mouse Follower 6 | 7 | 8 | 9 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap18/02-matrix_rotate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.18, p.481: The Matrix Class 6 | 7 | 8 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/05-waves_with_two_angles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.71: Waves with Two Angles 6 | 7 | 8 | 9 | 48 | 49 | 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/08-spring_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.205: Springing to a Moving Target 6 | 7 | 8 | 9 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/08-random_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.499: Biased Distribution - Multiple Iterations 6 | 7 | 8 | 9 | 48 | 49 | 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap18/04-skew_xy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.18, p.483: The Matrix Class - Skew X and Y 6 | 7 | 8 | 44 | 45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/06-waves_with_drawing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.71: Waves with the Drawing API 6 | 7 | 8 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/05-random_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.494: Circular Distribution 6 | 7 | 8 | 9 | 49 | 50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/10-follow_mouse_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.139: Angular Acceleration 6 | 7 | 8 | 9 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap10/02-rotation_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.10, p.253: Rotating a Single Object 6 | 7 | 8 | 9 | 47 | 48 | 49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/03-easing_off.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.197: When to Stop Easing 6 | 7 | 8 | 9 | 52 | 53 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/04-distance_collision_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.9, p.233: Simple Distance-Based Collision Detection 6 | 7 | 8 | 9 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/02-one_segment_drag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.352: Dragging with a Single Segment 6 | 7 | 8 | 9 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/03-reparenting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.39: The Display List 6 | 7 | 8 | 51 | 52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/06-random_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.496: Circular Distribution - Even Throughout Circle 6 | 7 | 8 | 9 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/07-spring_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.203: Springing in Two Dimensions 6 | 7 | 8 | 9 | 55 | 56 | 57 |
58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/07-key_codes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.47: Key Codes 6 | 7 | 8 | 55 | 56 | 57 |
58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/05-walking_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.331: Automating the Process 6 | 7 | 8 | 9 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/09-random_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.500: Biased Distribution - X and Y Axis 6 | 7 | 8 | 9 | 55 | 56 | 57 |
58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/06-friction_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.6, p.165: Friction, the Right Way 6 | 7 | 8 | 9 | 53 | 54 | 55 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap07/02-mouse_drag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.7, p.177: Dragging with mouseMove 6 | 7 | 8 | 9 | 49 | 50 | 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/05-distance_collision_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.9, p.235: Simple Distance-Based Collision Detection - Different Radius 6 | 7 | 8 | 9 | 50 | 51 | 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /src/primitives/constants/textalign.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true, devel: true, onevar: true, undef: true, regexp: true, bitwise: true, newcap: true*/ 2 | /*globals doodle*/ 3 | /** 4 | * @name doodle.TextAlign 5 | * @class 6 | * @static 7 | */ 8 | Object.defineProperty(doodle, 'TextAlign', { 9 | enumerable: true, 10 | writable: false, 11 | configurable: false, 12 | value: Object.create(null, { 13 | /** 14 | * @name START 15 | * @return {string} [read-only] 16 | * @property 17 | * @constant 18 | * @static 19 | */ 20 | 'START': { 21 | enumerable: true, 22 | writable: false, 23 | configurable: false, 24 | value: 'start' 25 | }, 26 | 27 | /** 28 | * @name END 29 | * @return {string} [read-only] 30 | * @property 31 | * @constant 32 | * @static 33 | */ 34 | 'END': { 35 | enumerable: true, 36 | writable: false, 37 | configurable: false, 38 | value: 'end' 39 | }, 40 | 41 | /** 42 | * @name LEFT 43 | * @return {string} [read-only] 44 | * @property 45 | * @constant 46 | * @static 47 | */ 48 | 'LEFT': { 49 | enumerable: true, 50 | writable: false, 51 | configurable: false, 52 | value: 'left' 53 | }, 54 | 55 | /** 56 | * @name RIGHT 57 | * @return {string} [read-only] 58 | * @property 59 | * @constant 60 | * @static 61 | */ 62 | 'RIGHT': { 63 | enumerable: true, 64 | writable: false, 65 | configurable: false, 66 | value: 'right' 67 | }, 68 | 69 | /** 70 | * @name CENTER 71 | * @return {string} [read-only] 72 | * @property 73 | * @constant 74 | * @static 75 | */ 76 | 'CENTER': { 77 | enumerable: true, 78 | writable: false, 79 | configurable: false, 80 | value: 'center' 81 | } 82 | }) 83 | }); 84 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/06-walking_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.332: Building a Natural Walk Cycle 6 | 7 | 8 | 9 | 51 | 52 | 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/04-reparenting_classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.42: Subclassing Display Objects 6 | 7 | 8 | 56 | 57 | 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/03-two_segment_drag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.352: Dragging Two Segments 6 | 7 | 8 | 9 | 52 | 53 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/07-acceleration_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.134: Acceleration on One Axis with Keys 6 | 7 | 8 | 9 | 56 | 57 | 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/09-distance_between_points.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.78: Distance Between Two Points 6 | 7 | 8 | 54 | 55 | 56 |
57 | 58 | 59 | -------------------------------------------------------------------------------- /doc/api/style/reset.css: -------------------------------------------------------------------------------- 1 | /** 2 | * HTML5 Reset Stylesheet: html5doctor.com 3 | */ 4 | 5 | html, body, div, span, object, iframe, 6 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 7 | abbr, address, cite, code, 8 | del, dfn, em, img, ins, kbd, q, samp, 9 | small, strong, sub, sup, var, 10 | b, i, 11 | dl, dt, dd, ol, ul, li, 12 | fieldset, form, label, legend, 13 | table, caption, tbody, tfoot, thead, tr, th, td, 14 | article, aside, canvas, details, figcaption, figure, 15 | footer, header, hgroup, menu, nav, section, summary, 16 | time, mark, audio, video { 17 | margin:0; 18 | padding:0; 19 | border:0; 20 | outline:0; 21 | font-size:100%; 22 | vertical-align:baseline; 23 | background:transparent; 24 | } 25 | 26 | body { 27 | line-height:1; 28 | } 29 | 30 | article,aside,details,figcaption,figure, 31 | footer,header,hgroup,menu,nav,section { 32 | display:block; 33 | } 34 | 35 | nav ul { 36 | list-style:none; 37 | } 38 | 39 | blockquote, q { 40 | quotes:none; 41 | } 42 | 43 | blockquote:before, blockquote:after, 44 | q:before, q:after { 45 | content:''; 46 | content:none; 47 | } 48 | 49 | a { 50 | margin:0; 51 | padding:0; 52 | font-size:100%; 53 | vertical-align:baseline; 54 | background:transparent; 55 | } 56 | 57 | /* change colours to suit your needs */ 58 | ins { 59 | background-color:#ff9; 60 | color:#000; 61 | text-decoration:none; 62 | } 63 | 64 | /* change colours to suit your needs */ 65 | mark { 66 | background-color:#ff9; 67 | color:#000; 68 | font-style:italic; 69 | font-weight:bold; 70 | } 71 | 72 | del { 73 | text-decoration: line-through; 74 | } 75 | 76 | abbr[title], dfn[title] { 77 | border-bottom:1px dotted; 78 | cursor:help; 79 | } 80 | 81 | table { 82 | border-collapse:collapse; 83 | border-spacing:0; 84 | } 85 | 86 | /* change border colour to suit your needs */ 87 | hr { 88 | display:block; 89 | height:1px; 90 | border:0; 91 | border-top:1px solid #cccccc; 92 | margin:1em 0; 93 | padding:0; 94 | } 95 | 96 | input, select { 97 | vertical-align:middle; 98 | } 99 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/05-mouse_events.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.44: Mouse Events 6 | 7 | 8 | 45 | 46 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap09/02-boxes_hit_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.9, p.228: Hit Testing Two Sprites - Stack Boxes 6 | 7 | 8 | 9 | 58 | 59 | 60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap15/01-perspective_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.15, p.379: Perspective 6 | 7 | 8 | 9 | 60 | 61 | 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap16/classes/Point3D.js: -------------------------------------------------------------------------------- 1 | function createPoint3D (x, y, z) { 2 | var _vpX = 0, 3 | _vpY = 0, 4 | _cX = 0, 5 | _cY = 0, 6 | _cZ = 0, 7 | point3d = doodle.createSprite(function () { 8 | this.x = (x === undefined) ? 0 : x; 9 | this.y = (y === undefined) ? 0 : y; 10 | this.z = (z === undefined) ? 0 : z; 11 | this.fl = 250; 12 | 13 | this.setVanishingPoint = function (vpX, vpY) { 14 | _vpX = vpX; 15 | _vpY = vpY; 16 | }; 17 | 18 | this.setCenter = function (cX, cY, cZ) { 19 | _cX = cX; 20 | _cY = cY; 21 | _cZ = cZ; 22 | }; 23 | 24 | this.rotateX = function (angleX) { 25 | var cosX = Math.cos(angleX), 26 | sinX = Math.sin(angleX), 27 | y1 = this.y * cosX - this.z * sinX, 28 | z1 = this.z * cosX + this.y * sinX; 29 | this.y = y1; 30 | this.z = z1; 31 | }; 32 | 33 | this.rotateY = function (angleY) { 34 | var cosY = Math.cos(angleY), 35 | sinY = Math.sin(angleY), 36 | x1 = this.x * cosY - this.z * sinY, 37 | z1 = this.z * cosY + this.x * sinY; 38 | this.x = x1; 39 | this.z = z1; 40 | }; 41 | 42 | this.rotateZ = function (angleZ) { 43 | var cosZ = Math.cos(angleZ), 44 | sinZ = Math.sin(angleZ), 45 | x1 = this.x * cosZ - this.y * sinZ, 46 | y1 = this.y * cosZ + this.x * sinZ; 47 | this.x = x1; 48 | this.y = y1; 49 | }; 50 | }); 51 | 52 | Object.defineProperties(point3d, { 53 | 'screenX': { 54 | get: function () { 55 | var scale = this.fl / (this.fl + this.z + _cZ); 56 | return _vpX + (_cX + this.x) * scale; 57 | } 58 | }, 59 | 'screenY': { 60 | get: function () { 61 | var scale = this.fl / (this.fl + this.z + _cZ); 62 | return _vpY + (_cY + this.y) * scale; 63 | } 64 | } 65 | }); 66 | 67 | return point3d; 68 | } 69 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap17/classes/Point3D.js: -------------------------------------------------------------------------------- 1 | function createPoint3D (x, y, z) { 2 | var _vpX = 0, 3 | _vpY = 0, 4 | _cX = 0, 5 | _cY = 0, 6 | _cZ = 0, 7 | point3d = doodle.createSprite(function () { 8 | this.x = (x === undefined) ? 0 : x; 9 | this.y = (y === undefined) ? 0 : y; 10 | this.z = (z === undefined) ? 0 : z; 11 | this.fl = 250; 12 | 13 | this.setVanishingPoint = function (vpX, vpY) { 14 | _vpX = vpX; 15 | _vpY = vpY; 16 | }; 17 | 18 | this.setCenter = function (cX, cY, cZ) { 19 | _cX = cX; 20 | _cY = cY; 21 | _cZ = cZ; 22 | }; 23 | 24 | this.rotateX = function (angleX) { 25 | var cosX = Math.cos(angleX), 26 | sinX = Math.sin(angleX), 27 | y1 = this.y * cosX - this.z * sinX, 28 | z1 = this.z * cosX + this.y * sinX; 29 | this.y = y1; 30 | this.z = z1; 31 | }; 32 | 33 | this.rotateY = function (angleY) { 34 | var cosY = Math.cos(angleY), 35 | sinY = Math.sin(angleY), 36 | x1 = this.x * cosY - this.z * sinY, 37 | z1 = this.z * cosY + this.x * sinY; 38 | this.x = x1; 39 | this.z = z1; 40 | }; 41 | 42 | this.rotateZ = function (angleZ) { 43 | var cosZ = Math.cos(angleZ), 44 | sinZ = Math.sin(angleZ), 45 | x1 = this.x * cosZ - this.y * sinZ, 46 | y1 = this.y * cosZ + this.x * sinZ; 47 | this.x = x1; 48 | this.y = y1; 49 | }; 50 | }); 51 | 52 | Object.defineProperties(point3d, { 53 | 'screenX': { 54 | get: function () { 55 | var scale = this.fl / (this.fl + this.z + _cZ); 56 | return _vpX + (_cX + this.x) * scale; 57 | } 58 | }, 59 | 'screenY': { 60 | get: function () { 61 | var scale = this.fl / (this.fl + this.z + _cZ); 62 | return _vpY + (_cY + this.y) * scale; 63 | } 64 | } 65 | }); 66 | 67 | return point3d; 68 | } 69 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap10/03-rotation_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.10, p.255: Rotating Multiple Objects 6 | 7 | 8 | 9 | 58 | 59 | 60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/04-bouncing_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.6, p.161: Bouncing 6 | 7 | 8 | 9 | 63 | 64 | 65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap02/01-event_sprite.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.2, p.34: Listeners and Handlers 6 | 7 | 8 | 52 | 53 | 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap03/10-mouse_distance.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.3, p.78: Mouse Distance 6 | 7 | 8 | 58 | 59 | 60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/09-spring_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.206: Show the Spring 6 | 7 | 8 | 9 | 61 | 62 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/05-bouncing_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.6, p.165: Bouncing - Adjust Bounce 6 | 7 | 8 | 9 | 64 | 65 | 66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/04-multi_segment_drag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.354: Dragging More Segments 6 | 7 | 8 | 9 | 59 | 60 | 61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap11/02-billiard_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.11, p.283: Conservation of Momentum on One Axis - Optimized 6 | 7 | 8 | 9 | 60 | 61 | 62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/08-cosines_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.369: The Law of Cosines 6 | 7 | 8 | 9 | 56 | 57 | 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/03-two_segments_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.328: Moving Two Segments 6 | 7 | 8 | 9 | 10 | 57 | 58 | 59 |
60 | 61 | 62 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/09-cosines_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.371: The Law of Cosines - Reverse 6 | 7 | 8 | 9 | 56 | 57 | 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/04-two_segments_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.330: Moving Two Segments - And Rotate 6 | 7 | 8 | 9 | 10 | 57 | 58 | 59 |
60 | 61 | 62 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap15/02-perspective_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.15, p.381: Perspective - Check Z Position 6 | 7 | 8 | 9 | 65 | 66 | 67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/08-acceleration_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.136: Acceleration on Two Axis 6 | 7 | 8 | 9 | 72 | 73 | 74 |
75 | 76 | 77 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/02-fountain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.6, p.155: Regenerating Objects 6 | 7 | 8 | 9 | 65 | 66 | 67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap14/05-two_segment_reach.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.14, p.360: Reaching for the Mouse 6 | 7 | 8 | 9 | 61 | 62 | 63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap11/01-billiard_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.11, p.280: Conservation of Momentum on One Axis 6 | 7 | 8 | 9 | 62 | 63 | 64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/09-gravity_acceleration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.138: Gravity as Acceleration 6 | 7 | 8 | 9 | 74 | 75 | 76 |
77 | 78 | 79 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/13-offset_spring.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.214: Offsetting the Target 6 | 7 | 8 | 9 | 64 | 65 | 66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/01-brownian_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.489: Brownian (Random) Motion 6 | 7 | 8 | 9 | 72 | 73 | 74 |
75 | 76 | 77 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap15/10-easing_3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.15, p.404: Easing 6 | 7 | 8 | 9 | 70 | 71 | 72 |
73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap07/01-mouse_events.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.7, p.175: Pressing and Releasing a Sprite 6 | 7 | 8 | 9 | 64 | 65 | 66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/02-easing_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.194: Simple Easing 2 6 | 7 | 8 | 9 | 65 | 66 | 67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/07-walking_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.333: Building a Natural Walk Cycle - Offset Segment 6 | 7 | 8 | 9 | 67 | 68 | 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap13/08-walking_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.13, p.334: Building a Natural Walk Cycle - Two Legs 6 | 7 | 8 | 9 | 67 | 68 | 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap06/01-boundary_remove_object.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.6, p.153: Removing Objects 6 | 7 | 8 | 9 | 65 | 66 | 67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap05/11-spaceship.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.5, p.141: Spaceship 6 | 7 | 8 | 9 | 78 | 79 | 80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap16/02-lines_3d_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.16, p.427: Creating Points and Lines - Point3D 6 | 7 | 8 | 9 | 69 | 70 | 71 |
72 | 73 | 74 | -------------------------------------------------------------------------------- /doc/api/fontvariant.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js - API: doodle.FontVariant 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 48 |
49 |

doodle.FontVariant

50 | 51 |
52 |

Description:

53 |
54 |
FontVariant
55 |
56 |

57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
71 |
72 |
73 |
74 | 75 |
76 |

Constants

77 |
78 |
NORMAL :string
79 |
80 |

81 |
82 | 83 | 84 | 85 |

Returns

86 |
    87 |
  • string – [read-only]
  • 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 |
96 |
97 |
SMALL_CAPS :string
98 |
99 |

100 |
101 | 102 | 103 | 104 |

Returns

105 |
    106 |
  • string – [read-only]
  • 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 |
115 |
116 |
117 |
118 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/api/gradienttype.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js - API: doodle.GradientType 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 48 |
49 |

doodle.GradientType

50 | 51 |
52 |

Description:

53 |
54 |
GradientType
55 |
56 |

57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
71 |
72 |
73 |
74 | 75 |
76 |

Constants

77 |
78 |
LINEAR :string
79 |
80 |

81 |
82 | 83 | 84 | 85 |

Returns

86 |
    87 |
  • string – [read-only]
  • 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 |
96 |
97 |
RADIAL :string
98 |
99 |

100 |
101 | 102 | 103 | 104 |

Returns

105 |
    106 |
  • string – [read-only]
  • 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 |
115 |
116 |
117 |
118 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap19/12-time_based_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.19, p.505: Time-Based Animation - Frame Independent 6 | 7 | 8 | 9 | 74 | 75 | 76 |
77 | 78 | 79 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap16/03-square_3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.16, p.429: Making Shapes - Spinning Square 6 | 7 | 8 | 9 | 70 | 71 | 72 |
73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/examples/making-things-move/chap08/10-chaining_springs_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Doodle.js -- Making Things Move: Ch.8, p.207: Chaining Springs 6 | 7 | 8 | 9 | 71 | 72 | 73 |
74 | 75 | 76 | --------------------------------------------------------------------------------