diff options
Diffstat (limited to 'docs/symbols/Karma.html')
-rwxr-xr-x | docs/symbols/Karma.html | 1505 |
1 files changed, 1505 insertions, 0 deletions
diff --git a/docs/symbols/Karma.html b/docs/symbols/Karma.html new file mode 100755 index 0000000..5db7dd2 --- /dev/null +++ b/docs/symbols/Karma.html @@ -0,0 +1,1505 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <meta name="generator" content="JsDoc Toolkit" /> + + <title>JsDoc Reference - Karma</title> + + <style type="text/css"> + /* default.css */ +body +{ + font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif; + width: 800px; +} + +.header +{ + clear: both; + background-color: #ccc; + padding: 8px; +} + +h1 +{ + font-size: 150%; + font-weight: bold; + padding: 0; + margin: 1em 0 0 .3em; +} + +hr +{ + border: none 0; + border-top: 1px solid #7F8FB1; + height: 1px; +} + +pre.code +{ + display: block; + padding: 8px; + border: 1px dashed #ccc; +} + +#index +{ + margin-top: 24px; + float: left; + width: 160px; + position: absolute; + left: 8px; + background-color: #F3F3F3; + padding: 8px; +} + +#content +{ + margin-left: 190px; + width: 600px; +} + +.classList +{ + list-style-type: none; + padding: 0; + margin: 0 0 0 8px; + font-family: arial, sans-serif; + font-size: 1em; + overflow: auto; +} + +.classList li +{ + padding: 0; + margin: 0 0 8px 0; +} + +.summaryTable { width: 100%; } + +h1.classTitle +{ + font-size:170%; + line-height:130%; +} + +h2 { font-size: 110%; } +caption, div.sectionTitle +{ + background-color: #7F8FB1; + color: #fff; + font-size:130%; + text-align: left; + padding: 2px 6px 2px 6px; + border: 1px #7F8FB1 solid; +} + +div.sectionTitle { margin-bottom: 8px; } +.summaryTable thead { display: none; } + +.summaryTable td +{ + vertical-align: top; + padding: 4px; + border-bottom: 1px #7F8FB1 solid; + border-right: 1px #7F8FB1 solid; +} + +/*col#summaryAttributes {}*/ +.summaryTable td.attributes +{ + border-left: 1px #7F8FB1 solid; + width: 140px; + text-align: right; +} + +td.attributes, .fixedFont +{ + line-height: 15px; + color: #002EBE; + font-family: "Courier New",Courier,monospace; + font-size: 13px; +} + +.summaryTable td.nameDescription +{ + text-align: left; + font-size: 13px; + line-height: 15px; +} + +.summaryTable td.nameDescription, .description +{ + line-height: 15px; + padding: 4px; + padding-left: 4px; +} + +.summaryTable { margin-bottom: 8px; } + +ul.inheritsList +{ + list-style: square; + margin-left: 20px; + padding-left: 0; +} + +.detailList { + margin-left: 20px; + line-height: 15px; +} +.detailList dt { margin-left: 20px; } + +.detailList .heading +{ + font-weight: bold; + padding-bottom: 6px; + margin-left: 0; +} + +.light, td.attributes, .light a:link, .light a:visited +{ + color: #777; + font-style: italic; +} + +.fineprint +{ + text-align: right; + font-size: 10px; +} + </style> + </head> + + <body> +<!-- ============================== header ================================= --> + <!-- begin static/header.html --> + <div id="header"> +</div> + <!-- end static/header.html --> + +<!-- ============================== classes index ============================ --> + <div id="index"> + <!-- begin publish.classesIndex --> + <div align="center"><a href="../index.html">Class Index</a> +| <a href="../files.html">File Index</a></div> +<hr /> +<h2>Classes</h2> +<ul class="classList"> + + <li><a href="../symbols/%24.ui.feedback.html">$.ui.feedback</a></li> + + <li><a href="../symbols/%24.ui.feedback.defaults.html">$.ui.feedback.defaults</a></li> + + <li><a href="../symbols/%24.ui.kFooter.html">$.ui.kFooter</a></li> + + <li><a href="../symbols/%24.ui.kFooter.defaults.html">$.ui.kFooter.defaults</a></li> + + <li><a href="../symbols/%24.ui.kHeader.html">$.ui.kHeader</a></li> + + <li><a href="../symbols/%24.ui.kHeader.defaults.html">$.ui.kHeader.defaults</a></li> + + <li><i><a href="../symbols/_global_.html">_global_</a></i></li> + + <li><a href="../symbols/Karma.html">Karma</a></li> + + <li><a href="../symbols/Karma.kAudio.html">Karma.kAudio</a></li> + + <li><a href="../symbols/Karma.kCanvas.html">Karma.kCanvas</a></li> + + <li><a href="../symbols/Karma.kImage.html">Karma.kImage</a></li> + + <li><a href="../symbols/Karma.kSvg.html">Karma.kSvg</a></li> + + <li><a href="../symbols/Karma.kVideo.html">Karma.kVideo</a></li> + +</ul> +<hr /> + <!-- end publish.classesIndex --> + </div> + + <div id="content"> +<!-- ============================== class title ============================ --> + <h1 class="classTitle"> + + Namespace Karma + </h1> + +<!-- ============================== class summary ========================== --> + <p class="description"> + + + + Global namespace for Karma library + + + <br /><i>Defined in: </i> <a href="../symbols/src/js_karma.js.html">karma.js</a>. + + </p> + +<!-- ============================== constructor summary ==================== --> + + <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class Karma."> + <caption>Namespace Summary</caption> + <thead> + <tr> + <th scope="col">Constructor Attributes</th> + <th scope="col">Constructor Name and Description</th> + </tr> + </thead> + <tbody> + <tr> + <td class="attributes"> </td> + <td class="nameDescription" > + <div class="fixedFont"> + <b><a href="../symbols/Karma.html#constructor">Karma</a></b> + </div> + <div class="description">Karma is the namespace for the Karma library and Karma() is the constructor +function for the Karma library object Karma.</div> + </td> + </tr> + </tbody> + </table> + + +<!-- ============================== properties summary ===================== --> + + + + <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class Karma."> + <caption>Field Summary</caption> + <thead> + <tr> + <th scope="col">Field Attributes</th> + <th scope="col">Field Name and Description</th> + </tr> + </thead> + <tbody> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont"> + Karma.<b><a href="../symbols/Karma.html#.audio">audio</a></b> + </div> + <div class="description">Collection of audio files with special helper +methods added to each reference</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont"> + Karma.<b><a href="../symbols/Karma.html#.canvas">canvas</a></b> + </div> + <div class="description">Collection of html 5 canvases with special helper +methods added to each reference</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont"> + Karma.<b><a href="../symbols/Karma.html#.image">image</a></b> + </div> + <div class="description">Collection of images with special helper +methods added to each reference</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont"> + Karma.<b><a href="../symbols/Karma.html#.locale">locale</a></b> + </div> + <div class="description">This is the global locale as passed to Karma(), +such as "en", "es_SP"</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont"> + Karma.<b><a href="../symbols/Karma.html#.svg">svg</a></b> + </div> + <div class="description">Collection of svgs with special helper +methods added to each reference</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont"> + Karma.<b><a href="../symbols/Karma.html#.video">video</a></b> + </div> + <div class="description">Collection of videos with special helper +methods added to each reference</div> + </td> + </tr> + + </tbody> + </table> + + + + + +<!-- ============================== methods summary ======================== --> + + + + <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class Karma."> + <caption>Method Summary</caption> + <thead> + <tr> + <th scope="col">Method Attributes</th> + <th scope="col">Method Name and Description</th> + </tr> + </thead> + <tbody> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#._n">_n</a></b>(Number, locale) + </div> + <div class="description"></div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.clone">clone</a></b>(target) + </div> + <div class="description">Returns a shallow copy of the passed in object</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.convertNumToLocale">convertNumToLocale</a></b>(Number, locale) + </div> + <div class="description">Converts a number to numerals in the specified locale.</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.copyObjectPlus">copyObjectPlus</a></b>(parent1, parent2) + </div> + <div class="description">Creates a new object that is a prototype of the first argument +then extends it with the properties of the second argument</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.create">create</a></b>(parent) + </div> + <div class="description">This emulates the Object.create method in ecmascript 5 spec +This isn't a full implementation as it doesn't support an all of Object.create's features +This has the same functionality as Crockford's beget method +and this primary building block for prototypal inheritance in +this library</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.distance">distance</a></b>(Point, Point) + </div> + <div class="description">Gets the Euclidian (ordinary) distance between 2 points.</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.distance2">distance2</a></b>(Point, Point) + </div> + <div class="description">Gets the square of the Euclidian (ordinary) distance between 2 points.</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.objectPlus">objectPlus</a></b>(target, source) + </div> + <div class="description">Extends properties of the target object with those of +the source object</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.radians">radians</a></b>(angle) + </div> + <div class="description">Converts a value from degrees to radians.</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.rand">rand</a></b>(lower, upper) + </div> + <div class="description">Returns a random number within the range provided</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.ready">ready</a></b>(cb) + </div> + <div class="description">Waits until all assets loaded(ready), then calls callback cb</div> + </td> + </tr> + + <tr> + <td class="attributes"><static> </td> + <td class="nameDescription"> + <div class="fixedFont">Karma.<b><a href="../symbols/Karma.html#.shuffle">shuffle</a></b>(oldList) + </div> + <div class="description">Shuffles an array of items randomly</div> + </td> + </tr> + + </tbody> + </table> + + + + +<!-- ============================== events summary ======================== --> + + +<!-- ============================== constructor details ==================== --> + + <div class="details"><a name="constructor"> </a> + <div class="sectionTitle"> + Namespace Detail + </div> + + <div class="fixedFont"> + <b>Karma</b> + </div> + + <div class="description"> + Karma is the namespace for the Karma library and Karma() is the constructor +function for the Karma library object Karma. +Karma() checks if the current document type is set to HTML 5, throws +an error if not. Otherwise, initializes the karma object and returns +a reference to that object. + + </div> + + + + <pre class="code"> +var k = Karma({ + image: [ + {name: "ninja", file: "ninja.png"}, + {name: "cowboy", file: "cowboy.png"} + ], + audio: [ + {name: "woosh", file: "woosh.ogg"}, + {name: "yeehaw", file: "yeehaw.ogg"} + ], + video: [ //Not Yet Implemented + {name: "attack", file: "attack.ogv"}, + {name: "ride", file: "ride.ogv"} + ] + canvas: [ + {name: "ninja", domId: "ninjaCanvas"}, + {name: "cowboy", domId: "cowboyCanvas"} + ], + svg: [ + {name: "ninja", domId: "ninjaSvg"}, + {name: "cowboy", domId: "cowboySvg"} + ], + }); +Next, call the ready function with a callback to your program code + +k.ready(function () { ... your application code . . . } + +after that you can access each asset like so +k.image.ninja; +k.svg.cowboy; +k.audio.yeehaw.play(); +k.canvas.ninja.drawImage(k.image.ninja, 0, 0);</pre> + + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>options</b> + <i>Optional, Default: {}</i> + </dt> + <dd>options for intializing Karma library</dd> + + <dt> + <span class="light fixedFont">{String}</span> <b>options.locale</b> + <i>Optional, Default: ''</i> + </dt> + <dd>sets current locale Not Yet Implemented</dd> + + <dt> + <span class="light fixedFont">{Array}</span> <b>options.image</b> + <i>Optional, Default: []</i> + </dt> + <dd>array of images to be converted into a collection</dd> + + <dt> + <span class="light fixedFont">{Array}</span> <b>options.audio</b> + <i>Optional, Default: []</i> + </dt> + <dd>array of audio to be converted into a collection</dd> + + <dt> + <span class="light fixedFont">{Array}</span> <b>options.video</b> + <i>Optional, Default: []</i> + </dt> + <dd>NYI array of videos to be converted into a collection</dd> + + <dt> + <span class="light fixedFont">{Array}</span> <b>options.svg</b> + <i>Optional, Default: []</i> + </dt> + <dd>array of SVG elements to be +converted into a collection. Each SVG element must already exist in the html document</dd> + + <dt> + <span class="light fixedFont">{Array}</span> <b>options.canvas</b> + <i>Optional, Default: []</i> + </dt> + <dd>array of canvas elements +to be converted into a collection. Each canvas element must already exist in the +html document and width and height of each element must be set as attributes</dd> + + </dl> + + + + + <dl class="detailList"> + <dt class="heading">Throws:</dt> + + <dt> + <span class="light fixedFont">{Error}</span> <b></b> + </dt> + <dd>if the document type declaration is not set to HTML 5, e.g. +<!DOCTYPE html></dd> + + <dt> + <span class="light fixedFont">{Error}</span> <b></b> + </dt> + <dd>If any of the initialization parameters are invalid values</dd> + + </dl> + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Object}</span> Karma -- reference to the initialized Karma library</dd> + + </dl> + + + + + </div> + + +<!-- ============================== field details ========================== --> + + <div class="sectionTitle"> + Field Detail + </div> + + <a name=".audio"> </a> + <div class="fixedFont"><static> + + <span class="light">{object}</span> + <span class="light">Karma.</span><b>audio</b> + + </div> + <div class="description"> + Collection of audio files with special helper +methods added to each reference + + + </div> + + + + + + + + <dl class="detailList"> + <dt class="heading">Default Value:</dt> + <dd> + empty object + </dd> + </dl> + + + <hr /> + + <a name=".canvas"> </a> + <div class="fixedFont"><static> + + <span class="light">{object}</span> + <span class="light">Karma.</span><b>canvas</b> + + </div> + <div class="description"> + Collection of html 5 canvases with special helper +methods added to each reference + + + </div> + + + + + + + + <dl class="detailList"> + <dt class="heading">Default Value:</dt> + <dd> + empty object + </dd> + </dl> + + + <hr /> + + <a name=".image"> </a> + <div class="fixedFont"><static> + + <span class="light">{object}</span> + <span class="light">Karma.</span><b>image</b> + + </div> + <div class="description"> + Collection of images with special helper +methods added to each reference + + + </div> + + + + + + + + <dl class="detailList"> + <dt class="heading">Default Value:</dt> + <dd> + empty object + </dd> + </dl> + + + <hr /> + + <a name=".locale"> </a> + <div class="fixedFont"><static> + + + <span class="light">Karma.</span><b>locale</b> + + </div> + <div class="description"> + This is the global locale as passed to Karma(), +such as "en", "es_SP" + + + </div> + + + + + + + + <dl class="detailList"> + <dt class="heading">Default Value:</dt> + <dd> + 'en' + </dd> + </dl> + + + <hr /> + + <a name=".svg"> </a> + <div class="fixedFont"><static> + + <span class="light">{object}</span> + <span class="light">Karma.</span><b>svg</b> + + </div> + <div class="description"> + Collection of svgs with special helper +methods added to each reference + + + </div> + + + + + + + + <dl class="detailList"> + <dt class="heading">Default Value:</dt> + <dd> + empty object + </dd> + </dl> + + + <hr /> + + <a name=".video"> </a> + <div class="fixedFont"><static> + + <span class="light">{object}</span> + <span class="light">Karma.</span><b>video</b> + + </div> + <div class="description"> + Collection of videos with special helper +methods added to each reference + + + </div> + + + + + + + + <dl class="detailList"> + <dt class="heading">Default Value:</dt> + <dd> + empty object + </dd> + </dl> + + + + + + +<!-- ============================== method details ========================= --> + + <div class="sectionTitle"> + Method Detail + </div> + + <a name="._n"> </a> + <div class="fixedFont"><static> + + <span class="light">{String}</span> + <span class="light">Karma.</span><b>_n</b>(Number, locale) + + </div> + <div class="description"> + + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Number</b> + + </dt> + <dd>to be converted</dd> + + <dt> + <span class="light fixedFont">{locale}</span> <b>locale</b> + + </dt> + <dd>that number should be converted to</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{String}</span> Unicode string for localized numeral</dd> + + </dl> + + + + + <hr /> + + <a name=".clone"> </a> + <div class="fixedFont"><static> + + <span class="light">{Object}</span> + <span class="light">Karma.</span><b>clone</b>(target) + + </div> + <div class="description"> + Returns a shallow copy of the passed in object + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>target</b> + + </dt> + <dd>to be copied</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Object}</span> a shallow copy of target</dd> + + </dl> + + + + + <hr /> + + <a name=".convertNumToLocale"> </a> + <div class="fixedFont"><static> + + <span class="light">{String}</span> + <span class="light">Karma.</span><b>convertNumToLocale</b>(Number, locale) + + </div> + <div class="description"> + Converts a number to numerals in the specified locale. Currently only +supports Nepali + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Number</b> + + </dt> + <dd>to be converted</dd> + + <dt> + <span class="light fixedFont">{locale}</span> <b>locale</b> + + </dt> + <dd>that number should be converted to</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{String}</span> Unicode string for localized numeral</dd> + + </dl> + + + + + <hr /> + + <a name=".copyObjectPlus"> </a> + <div class="fixedFont"><static> + + <span class="light">{Object}</span> + <span class="light">Karma.</span><b>copyObjectPlus</b>(parent1, parent2) + + </div> + <div class="description"> + Creates a new object that is a prototype of the first argument +then extends it with the properties of the second argument + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>parent1</b> + + </dt> + <dd>will be prototype of returned object</dd> + + <dt> + <span class="light fixedFont">{Object}</span> <b>parent2</b> + + </dt> + <dd>will extend properties of returned object</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Object}</span> object that whose prototype is parent1 and has +been extended with properties of parent2</dd> + + </dl> + + + + + <hr /> + + <a name=".create"> </a> + <div class="fixedFont"><static> + + <span class="light">{Object}</span> + <span class="light">Karma.</span><b>create</b>(parent) + + </div> + <div class="description"> + This emulates the Object.create method in ecmascript 5 spec +This isn't a full implementation as it doesn't support an all of Object.create's features +This has the same functionality as Crockford's beget method +and this primary building block for prototypal inheritance in +this library + + + </div> + + + + <pre class="code"> +var ninja = { weapon : "sword" }; +var ninja1 = Karma.create(ninja); +ninja1.weapon === "sword"</pre> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>parent</b> + + </dt> + <dd>that the new object's prototype should point to</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Object}</span> a new object whose prototype is parent</dd> + + </dl> + + + + + <hr /> + + <a name=".distance"> </a> + <div class="fixedFont"><static> + + <span class="light">{Number}</span> + <span class="light">Karma.</span><b>distance</b>(Point, Point) + + </div> + <div class="description"> + Gets the Euclidian (ordinary) distance between 2 points.<br> +<b>Warning:</b> It's slower than distance2 function + + + </div> + + + + <pre class="code"> +p0 = {x:0, y:1}; +p1 = {x:50, y:70}; +var d = distance2(p0, p1);</pre> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>Point</b> + + </dt> + <dd>No. 0</dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point0.x</b> + + </dt> + <dd></dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point0.y</b> + + </dt> + <dd></dd> + + <dt> + <span class="light fixedFont">{Object}</span> <b>Point</b> + + </dt> + <dd>No. 1</dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point1.x</b> + + </dt> + <dd></dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point1.y</b> + + </dt> + <dd></dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Number}</span> The Euclidian distance</dd> + + </dl> + + + + + <hr /> + + <a name=".distance2"> </a> + <div class="fixedFont"><static> + + <span class="light">{Number}</span> + <span class="light">Karma.</span><b>distance2</b>(Point, Point) + + </div> + <div class="description"> + Gets the square of the Euclidian (ordinary) distance between 2 points. + + + </div> + + + + <pre class="code"> +p0 = {x:0, y:1}; +p1 = {x:50, y:70}; +var d = distance2(p0, p1);</pre> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>Point</b> + + </dt> + <dd>No. 0</dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point0.x</b> + + </dt> + <dd></dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point0.y</b> + + </dt> + <dd></dd> + + <dt> + <span class="light fixedFont">{Object}</span> <b>Point</b> + + </dt> + <dd>No. 1</dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point1.x</b> + + </dt> + <dd></dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>Point1.y</b> + + </dt> + <dd></dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Number}</span> The square of the Euclidian distance</dd> + + </dl> + + + + + <hr /> + + <a name=".objectPlus"> </a> + <div class="fixedFont"><static> + + <span class="light">{Object}</span> + <span class="light">Karma.</span><b>objectPlus</b>(target, source) + + </div> + <div class="description"> + Extends properties of the target object with those of +the source object + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Object}</span> <b>target</b> + + </dt> + <dd>object to be extended</dd> + + <dt> + <span class="light fixedFont">{Object}</span> <b>source</b> + + </dt> + <dd>whose properties will extend target</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Object}</span> target extended by source</dd> + + </dl> + + + + + <hr /> + + <a name=".radians"> </a> + <div class="fixedFont"><static> + + <span class="light">{Number}</span> + <span class="light">Karma.</span><b>radians</b>(angle) + + </div> + <div class="description"> + Converts a value from degrees to radians. + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Number}</span> <b>angle</b> + + </dt> + <dd>The angle in degrees</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Number}</span> The angle in radians</dd> + + </dl> + + + + + <hr /> + + <a name=".rand"> </a> + <div class="fixedFont"><static> + + <span class="light">{Number}</span> + <span class="light">Karma.</span><b>rand</b>(lower, upper) + + </div> + <div class="description"> + Returns a random number within the range provided + + + </div> + + + + <pre class="code"> +var num = rand(0, 10); + +//num could be 0, 1, 2, 3 ... or 10</pre> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Number}</span> <b>lower</b> + + </dt> + <dd>limit of the range, lowest number that can be returned</dd> + + <dt> + <span class="light fixedFont">{Number}</span> <b>upper</b> + + </dt> + <dd>limit of the range, highest number that can be returned</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Number}</span> number that is >= lower and <= upper</dd> + + </dl> + + + + + <hr /> + + <a name=".ready"> </a> + <div class="fixedFont"><static> + + + <span class="light">Karma.</span><b>ready</b>(cb) + + </div> + <div class="description"> + Waits until all assets loaded(ready), then calls callback cb + + + </div> + + + + <pre class="code"> +var k = Karma({ . . . your assets here . . . }); +k.ready(function(){ .. your code here . . .}); + +your code will not be called until all assets have been loaded +into collections</pre> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Function}</span> <b>cb</b> + <i>Optional</i> + </dt> + <dd>callback function</dd> + + </dl> + + + + + <dl class="detailList"> + <dt class="heading">Throws:</dt> + + <dt> + <span class="light fixedFont">{Error}</span> <b></b> + </dt> + <dd>if Karma is not initialized with the +Karma({ options }) function</dd> + + </dl> + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd>this</dd> + + </dl> + + + + + <hr /> + + <a name=".shuffle"> </a> + <div class="fixedFont"><static> + + <span class="light">{Array}</span> + <span class="light">Karma.</span><b>shuffle</b>(oldList) + + </div> + <div class="description"> + Shuffles an array of items randomly + + + </div> + + + + + <dl class="detailList"> + <dt class="heading">Parameters:</dt> + + <dt> + <span class="light fixedFont">{Array}</span> <b>oldList</b> + + </dt> + <dd>of choices to be shuffled</dd> + + </dl> + + + + + + <dl class="detailList"> + <dt class="heading">Returns:</dt> + + <dd><span class="light fixedFont">{Array}</span> newlist of choices randomly reordered</dd> + + </dl> + + + + + + + + +<!-- ============================== event details ========================= --> + + + <hr /> + </div> + + +<!-- ============================== footer ================================= --> + <div class="fineprint" style="clear:both"> + + Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Wed Feb 17 2010 14:55:42 GMT+0545 (NPT) + </div> + </body> +</html> |