/* * * Jaws - a HTML5 canvas/javascript 2D game development framework * * Homepage: http://jawsjs.com/ * Works with: Chrome 6.0+, Firefox 3.6+, 4+, IE 9+ * License: LGPL - http://www.gnu.org/licenses/lgpl.html * * Formating guide: * * jaws.oneFunction() * jaws.one_variable = 1 * new jaws.OneConstructor * * Jaws uses the "module pattern" and exposes itself through the global "jaws". * It should play nice with all other JS libs. * * Have fun! * * ippa. * */ var jaws = (function(jaws) { var title var log_tag jaws.title = function(value) { if(value) { return (title.innerHTML = value) } return title.innerHTML } /* * Unpacks Jaws core-constructors into the global namespace * After calling unpack you can use: * "Sprite()" instead of "jaws.Sprite()" * "Animation()" instead of "jaws.Animation()" * .. and so on. * */ jaws.unpack = function() { var make_global = ["Sprite", "SpriteList", "Animation", "Viewport", "SpriteSheet", "Parallax", "TileMap", "Rect", "pressed"] make_global.forEach( function(item, array, total) { if(window[item]) { jaws.log(item + "already exists in global namespace") } else { window[item] = jaws[item] } }); } /* * Logger, adds text to previously found or created