Files
CanvasLoader/docs/CanvasLoader.html
T
Robert Pataki 4887e28697 Safe VML mode, auto hiding and optional constructor parameters added.
- safeMode added to make high density VML mode rendering CPU sensible,
- Optional parameters added to the constructor with [id] and [safeVML]
parameters,
- Autohide added, the loader instances don't start rendering until the
show() method is called,
- Minified file is updated,
- Documentation is updated,
- Example html file is updated
2011-10-22 16:52:29 +01:00

1627 lines
88 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>API: CanvasLoader CanvasLoader (Heartcode CanvasLoader)</title>
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
<link rel="stylesheet" type="text/css" href="assets/api.css" />
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h1><a href="http://heartcode.robertpataki.com/canvasloader/" title="Heartcode CanvasLoader YUI Library">Heartcode CanvasLoader YUI Library</a></h1>
<h3>CanvasLoader&nbsp; <span class="subtitle">0.9.0</span></h3>
<a href="./index.html" title="Heartcode CanvasLoader YUI Library">Heartcode CanvasLoader YUI Library</a>
&gt; <a href="./module_canvasloader.html" title="CanvasLoader">CanvasLoader</a>
&gt; CanvasLoader
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
&nbsp;
</div>
</div>
</form>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
<fieldset>
<legend>Filters</legend>
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
</fieldset>
</form>
<h2>
Class <b property="yui:name">CanvasLoader</b>
<span class="extends">
</span>
</h2>
<!-- class tree goes here -->
<div class="summary description" property="yui:description">
CanvasLoader is a JavaScript UI library that draws and animates circular preloaders using the Canvas HTML object.<br/><br/>
A CanvasLoader instance creates two canvas elements which are placed into a placeholder div (the id of the div has to be passed in the constructor). The second canvas is invisible and used for caching purposes only.<br/><br/>
If no id is passed in the constructor, the canvas objects are paced in the document directly.
</div>
<div class="section constructor details" rel="yui:constructor" resource="#constructor">
<h3 id="constructor">Constructor</h3>
<div class="content">
<div class="detail">
<strong property="yui:name">CanvasLoader</strong>
<code>
(
id
,
opt
)
</code>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">id</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The id of the placeholder div</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">opt</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> Optional parameters<br/><br/>
<strong>Possible values of optional parameters:</strong><br/>
<ul>
<li><strong>id (String):</strong> The id of the CanvasLoader instance</li>
<li><strong>safeVML (Boolean):</strong> If set to true, the amount of CanvasLoader shapes are limited in VML mode. It prevents CPU overkilling when rendering loaders with high density. The default value is true.</li></span>
</dd>
</dl>
</div>
</div>
</div>
</div>
<div rel="yui:properties" resource="#properties">
<div class="section field details">
<h3 id="properties">Properties</h3>
<div class="content">
<div class="protected" rel="yui:property" resource="#property_activeId">
<h4><a name="property_activeId" property="yui:name">activeId</a>
- <code>protected <span property="yui:type">Number</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The active shape id for rendering
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_can">
<h4><a name="property_can" property="yui:name">can</a>
- <code>protected <span property="yui:type">Object</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The div we draw the shapes into
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_cCan">
<h4><a name="property_cCan" property="yui:name">cCan</a>
- <code>protected <span property="yui:type">Object</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The canvas we use for caching
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_cCon">
<h4><a name="property_cCon" property="yui:name">cCon</a>
- <code>protected <span property="yui:type">Object</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The context of the cache canvas
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_color">
<h4><a name="property_color" property="yui:name">color</a>
- <code>protected <span property="yui:type">String</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The color of the loader shapes in HEX
</div>
</div>
<div class="default" property="yui:defaultValue">
Default Value: "#000000"
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_con">
<h4><a name="property_con" property="yui:name">con</a>
- <code>protected <span property="yui:type">Object</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The canvas context
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_cont">
<h4><a name="property_cont" property="yui:name">cont</a>
- <code>protected <span property="yui:type">Object</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The div we place the canvas object into
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_cRGB">
<h4><a name="property_cRGB" property="yui:name">cRGB</a>
- <code>protected <span property="yui:type">Object</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The color of the loader shapes in RGB
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_density">
<h4><a name="property_density" property="yui:name">density</a>
- <code>protected <span property="yui:type">Number</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The number of shapes drawn on the loader canvas
</div>
</div>
<div class="default" property="yui:defaultValue">
Default Value: 40
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_diameter">
<h4><a name="property_diameter" property="yui:name">diameter</a>
- <code>protected <span property="yui:type">Number</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The diameter of the loader
</div>
</div>
<div class="default" property="yui:defaultValue">
Default Value: 40
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_fps">
<h4><a name="property_fps" property="yui:name">fps</a>
- <code>protected <span property="yui:type">Number</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The FPS value of the loader animation rendering
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_range">
<h4><a name="property_range" property="yui:name">range</a>
- <code>protected <span property="yui:type">Number</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The amount of the modified shapes in percent.
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_ready">
<h4><a name="property_ready" property="yui:name">ready</a>
- <code>protected <span property="yui:type">Boolean</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
Tells if the canvas and its context is ready
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_shape">
<h4><a name="property_shape" property="yui:name">shape</a>
- <code>protected <span property="yui:type">String</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The type of the loader shapes
</div>
</div>
<div class="default" property="yui:defaultValue">
Default Value: "oval"
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_speed">
<h4><a name="property_speed" property="yui:name">speed</a>
- <code>protected <span property="yui:type">Number</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The speed of the loader animation
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:property" resource="#property_timer">
<h4><a name="property_timer" property="yui:name">timer</a>
- <code>protected <span property="yui:type">Boolean</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
Adds a timer for the rendering
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div rel="yui:methods" resource="#methods">
<div class="section method details">
<h3 id="methods">Methods</h3>
<div class="content">
<div class="protected" rel="yui:method" resource="#method_addEl">
<h4>
<a name="method_addEl">addEl</a></h4>
<div class="detail" >
<code>
protected
Object
<strong property="yui:name">addEl</strong>
(
tag
,
par
,
opt
)
</code>
<div class="description" property="yui:description">
Creates a new element with the tag and applies the passed properties on it
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">tag</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The tag to be created</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">par</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The DOM element the new element will be appended to</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">opt</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> Additional properties passed to the new DOM element</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">The DOM element</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_clean">
<h4>
<a name="method_clean">clean</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">clean</strong>
(
)
</code>
<div class="description" property="yui:description">
Cleans the canvas
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_draw">
<h4>
<a name="method_draw">draw</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">draw</strong>
(
)
</code>
<div class="description" property="yui:description">
Draw the shapes on the canvas
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getColor">
<h4>
<a name="method_getColor">getColor</a></h4>
<div class="detail" >
<code>
String
<strong property="yui:name">getColor</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the loader color in a hexadecimal form
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getDensity">
<h4>
<a name="method_getDensity">getDensity</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">getDensity</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the number of shapes drawn on the loader canvas
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getDiameter">
<h4>
<a name="method_getDiameter">getDiameter</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">getDiameter</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the diameter of the loader.
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getFPS">
<h4>
<a name="method_getFPS">getFPS</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">getFPS</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the fps of the loader
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getRange">
<h4>
<a name="method_getRange">getRange</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">getRange</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the modified shape range in percent
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_getRGB">
<h4>
<a name="method_getRGB">getRGB</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">getRGB</strong>
(
color
)
</code>
<div class="description" property="yui:description">
Return the RGB values of the passed color
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">color</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The HEX color value to be converted to RGB</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getShape">
<h4>
<a name="method_getShape">getShape</a></h4>
<div class="detail" >
<code>
String
<strong property="yui:name">getShape</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the type of the loader shapes
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getSpeed">
<h4>
<a name="method_getSpeed">getSpeed</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">getSpeed</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the speed of the loader animation
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_hide">
<h4>
<a name="method_hide">hide</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">hide</strong>
(
)
</code>
<div class="description" property="yui:description">
Stops the rendering of the loader animation and hides the loader
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_init">
<h4>
<a name="method_init">init</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">init</strong>
(
id
,
opt
)
</code>
<div class="description" property="yui:description">
Initialization method
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">id</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The id of the placeholder div, where the loader will be nested into</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">opt</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> Optional parameters<br/><br/>
<strong>Possible values of optional parameters:</strong><br/>
<ul>
<li><strong>id (String):</strong> The id of the CanvasLoader instance</li>
<li><strong>safeVML (Boolean):</strong> If set to true, the amount of CanvasLoader shapes are limited in VML mode. It prevents CPU overkilling when rendering loaders with high density. The default value is true.</li></span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_kill">
<h4>
<a name="method_kill">kill</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">kill</strong>
(
)
</code>
<div class="description" property="yui:description">
Removes the CanvasLoader instance and all its references
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_redraw">
<h4>
<a name="method_redraw">redraw</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">redraw</strong>
(
)
</code>
<div class="description" property="yui:description">
Redraws the canvas
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_reset">
<h4>
<a name="method_reset">reset</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">reset</strong>
(
)
</code>
<div class="description" property="yui:description">
Resets the timer
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_setAttr">
<h4>
<a name="method_setAttr">setAttr</a></h4>
<div class="detail" >
<code>
protected
Object
<strong property="yui:name">setAttr</strong>
(
el
,
opt
)
</code>
<div class="description" property="yui:description">
Sets the attributes on the element
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">el</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> The DOM element to add the attributes to</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">opt</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> The attributes</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">The DOM element</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setColor">
<h4>
<a name="method_setColor">setColor</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setColor</strong>
(
color
)
</code>
<div class="description" property="yui:description">
Sets hexadecimal color of the loader
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">color</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The default value is '#000000'</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_setCSS">
<h4>
<a name="method_setCSS">setCSS</a></h4>
<div class="detail" >
<code>
protected
Object
<strong property="yui:name">setCSS</strong>
(
el
,
opt
)
</code>
<div class="description" property="yui:description">
Sets the css properties on the element
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">el</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> The DOM element to be styled</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">opt</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> The style properties</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">The DOM element</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setDensity">
<h4>
<a name="method_setDensity">setDensity</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setDensity</strong>
(
density
)
</code>
<div class="description" property="yui:description">
Sets the number of shapes drawn on the loader canvas
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">density</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> The default value is 40</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setDiameter">
<h4>
<a name="method_setDiameter">setDiameter</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setDiameter</strong>
(
diameter
)
</code>
<div class="description" property="yui:description">
Sets the diameter of the loader
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">diameter</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> The default value is 40</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setFPS">
<h4>
<a name="method_setFPS">setFPS</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setFPS</strong>
(
fps
)
</code>
<div class="description" property="yui:description">
Sets the rendering frequency.<br/>
This value tells the loader how many times to refresh and modify the canvas in 1 second.<br/>
Using the right combination of the <code>setSpeed</code> and the <code>setFPS</code> methods allows the users to optimize the CPU usage of the loader whilst keeping the animation on a visually pleasing level.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">fps</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> The default value is 24</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setRange">
<h4>
<a name="method_setRange">setRange</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setRange</strong>
(
range
)
</code>
<div class="description" property="yui:description">
Sets the amount of the modified shapes in percent.<br/>
With this value the user can set what range of the shapes should be scaled and/or faded. The shapes that are out of this range will be scaled and/or faded with a minimum amount only.<br/>
This minimum amount is 0.1 which means every shape which is out of the range is scaled and/or faded to 10% of the original values.<br/>
The visually acceptable range value should be between 0.4 and 1.5.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">range</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> The default value is 1.3</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setShape">
<h4>
<a name="method_setShape">setShape</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setShape</strong>
(
shape
)
</code>
<div class="description" property="yui:description">
Sets the type of the loader shapes.<br/>
<br/><b>The acceptable values are:</b>
<ul>
<li>'oval'</li>
<li>'spiral'</li>
<li>'square'</li>
<li>'rect'</li>
<li>'roundRect'</li>
</ul>
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">shape</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> The default value is 'oval'</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setSpeed">
<h4>
<a name="method_setSpeed">setSpeed</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setSpeed</strong>
(
speed
)
</code>
<div class="description" property="yui:description">
Sets the speed of the loader animation.<br/>
This value tells the loader how many shapes to skip by each tick.<br/>
Using the right combination of the <code>setFPS</code> and the <code>setSpeed</code> methods allows the users to optimize the CPU usage of the loader whilst keeping the animation on a visually pleasing level.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">speed</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> The default value is 2</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_show">
<h4>
<a name="method_show">show</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">show</strong>
(
)
</code>
<div class="description" property="yui:description">
Shows the rendering of the loader animation
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_tick">
<h4>
<a name="method_tick">tick</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">tick</strong>
(
)
</code>
<div class="description" property="yui:description">
Renders the loader animation
</div>
<div class="description">
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method_transCon">
<h4>
<a name="method_transCon">transCon</a></h4>
<div class="detail" >
<code>
protected
void
<strong property="yui:name">transCon</strong>
(
x
,
y
,
r
)
</code>
<div class="description" property="yui:description">
Transforms the cache canvas before drawing
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">x</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> The canvas context to be transformed</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">x</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> x translation</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">y</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> y translation</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">r</span>
&lt;<span property="yui:type">Number</span>&gt;
</code>
<span property="yui:description"> Rotation radians</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div rel="yui:events" resource="#events">
</div>
<div rel="yui:attributes" resource="#configattributes">
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div id="moduleList" class="module">
<h4>Modules</h4>
<ul class="content">
<li class="selected"><a href="module_canvasloader.html" title="CanvasLoader">CanvasLoader</a></li>
</ul>
</div>
<div id="classList" class="module">
<h4>Classes</h4>
<ul class="content">
<li class="selected"><a href="CanvasLoader.html" title="CanvasLoader">CanvasLoader</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="heartcode-canvasloader.js.html" title="heartcode-canvasloader.js">heartcode-canvasloader.js</a></li>
</ul>
</div>
<div id="propertyList" class="module">
<h4>Properties</h4>
<ul class="content">
<li class="protected"><a href="#property_activeId" title="activeId">activeId</a></li>
<li class="protected"><a href="#property_can" title="can">can</a></li>
<li class="protected"><a href="#property_cCan" title="cCan">cCan</a></li>
<li class="protected"><a href="#property_cCon" title="cCon">cCon</a></li>
<li class="protected"><a href="#property_color" title="color">color</a></li>
<li class="protected"><a href="#property_con" title="con">con</a></li>
<li class="protected"><a href="#property_cont" title="cont">cont</a></li>
<li class="protected"><a href="#property_cRGB" title="cRGB">cRGB</a></li>
<li class="protected"><a href="#property_density" title="density">density</a></li>
<li class="protected"><a href="#property_diameter" title="diameter">diameter</a></li>
<li class="protected"><a href="#property_fps" title="fps">fps</a></li>
<li class="protected"><a href="#property_range" title="range">range</a></li>
<li class="protected"><a href="#property_ready" title="ready">ready</a></li>
<li class="protected"><a href="#property_shape" title="shape">shape</a></li>
<li class="protected"><a href="#property_speed" title="speed">speed</a></li>
<li class="protected"><a href="#property_timer" title="timer">timer</a></li>
</ul>
</div>
<div id="methodsList" class="module">
<h4>Methods</h4>
<ul class="content">
<li class="protected"><a href="#method_addEl" title="addEl">addEl</a></li>
<li class="protected"><a href="#method_clean" title="clean">clean</a></li>
<li class="protected"><a href="#method_draw" title="draw">draw</a></li>
<li class=""><a href="#method_getColor" title="getColor">getColor</a></li>
<li class=""><a href="#method_getDensity" title="getDensity">getDensity</a></li>
<li class=""><a href="#method_getDiameter" title="getDiameter">getDiameter</a></li>
<li class=""><a href="#method_getFPS" title="getFPS">getFPS</a></li>
<li class=""><a href="#method_getRange" title="getRange">getRange</a></li>
<li class="protected"><a href="#method_getRGB" title="getRGB">getRGB</a></li>
<li class=""><a href="#method_getShape" title="getShape">getShape</a></li>
<li class=""><a href="#method_getSpeed" title="getSpeed">getSpeed</a></li>
<li class=""><a href="#method_hide" title="hide">hide</a></li>
<li class="protected"><a href="#method_init" title="init">init</a></li>
<li class=""><a href="#method_kill" title="kill">kill</a></li>
<li class="protected"><a href="#method_redraw" title="redraw">redraw</a></li>
<li class="protected"><a href="#method_reset" title="reset">reset</a></li>
<li class="protected"><a href="#method_setAttr" title="setAttr">setAttr</a></li>
<li class=""><a href="#method_setColor" title="setColor">setColor</a></li>
<li class="protected"><a href="#method_setCSS" title="setCSS">setCSS</a></li>
<li class=""><a href="#method_setDensity" title="setDensity">setDensity</a></li>
<li class=""><a href="#method_setDiameter" title="setDiameter">setDiameter</a></li>
<li class=""><a href="#method_setFPS" title="setFPS">setFPS</a></li>
<li class=""><a href="#method_setRange" title="setRange">setRange</a></li>
<li class=""><a href="#method_setShape" title="setShape">setShape</a></li>
<li class=""><a href="#method_setSpeed" title="setSpeed">setSpeed</a></li>
<li class=""><a href="#method_show" title="show">show</a></li>
<li class="protected"><a href="#method_tick" title="tick">tick</a></li>
<li class="protected"><a href="#method_transCon" title="transCon">transCon</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright &copy; 2011 Róbert Pataki. The Heartcode CanvasLoader is released under the MIT licence. For more information and other open source stuff please visit the <a href="http://heartcode.robertpataki.com/" target="_blank">Heartcode blog</a>, check out my <a href="http://github.com/heartcode" target="_blank">GitHub profile</a> and follow the <a href="http://twitter.com/#!/@iHeartcode" target="_blank">Heartcode tweets</a>.
</div>
</div>
<script type="text/javascript">
var ALL_YUI_PROPS = [{"url": "CanvasLoader.html#property_activeId", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "activeId"}, {"url": "CanvasLoader.html#method_addEl", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "addEl"}, {"url": "CanvasLoader.html#property_can", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "can"}, {"url": "CanvasLoader.html#property_cCan", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "cCan"}, {"url": "CanvasLoader.html#property_cCon", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "cCon"}, {"url": "CanvasLoader.html#method_clean", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "clean"}, {"url": "CanvasLoader.html#property_color", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "color"}, {"url": "CanvasLoader.html#property_con", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "con"}, {"url": "CanvasLoader.html#property_cont", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "cont"}, {"url": "CanvasLoader.html#property_cRGB", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "cRGB"}, {"url": "CanvasLoader.html#property_density", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "density"}, {"url": "CanvasLoader.html#property_diameter", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "diameter"}, {"url": "CanvasLoader.html#method_draw", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "draw"}, {"url": "CanvasLoader.html#property_fps", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "fps"}, {"url": "CanvasLoader.html#method_getColor", "access": "", "host": "CanvasLoader", "type": "method", "name": "getColor"}, {"url": "CanvasLoader.html#method_getDensity", "access": "", "host": "CanvasLoader", "type": "method", "name": "getDensity"}, {"url": "CanvasLoader.html#method_getDiameter", "access": "", "host": "CanvasLoader", "type": "method", "name": "getDiameter"}, {"url": "CanvasLoader.html#method_getFPS", "access": "", "host": "CanvasLoader", "type": "method", "name": "getFPS"}, {"url": "CanvasLoader.html#method_getRange", "access": "", "host": "CanvasLoader", "type": "method", "name": "getRange"}, {"url": "CanvasLoader.html#method_getRGB", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "getRGB"}, {"url": "CanvasLoader.html#method_getShape", "access": "", "host": "CanvasLoader", "type": "method", "name": "getShape"}, {"url": "CanvasLoader.html#method_getSpeed", "access": "", "host": "CanvasLoader", "type": "method", "name": "getSpeed"}, {"url": "CanvasLoader.html#method_hide", "access": "", "host": "CanvasLoader", "type": "method", "name": "hide"}, {"url": "CanvasLoader.html#method_init", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "init"}, {"url": "CanvasLoader.html#method_kill", "access": "", "host": "CanvasLoader", "type": "method", "name": "kill"}, {"url": "CanvasLoader.html#property_range", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "range"}, {"url": "CanvasLoader.html#property_ready", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "ready"}, {"url": "CanvasLoader.html#method_redraw", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "redraw"}, {"url": "CanvasLoader.html#method_reset", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "reset"}, {"url": "CanvasLoader.html#method_setAttr", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "setAttr"}, {"url": "CanvasLoader.html#method_setColor", "access": "", "host": "CanvasLoader", "type": "method", "name": "setColor"}, {"url": "CanvasLoader.html#method_setCSS", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "setCSS"}, {"url": "CanvasLoader.html#method_setDensity", "access": "", "host": "CanvasLoader", "type": "method", "name": "setDensity"}, {"url": "CanvasLoader.html#method_setDiameter", "access": "", "host": "CanvasLoader", "type": "method", "name": "setDiameter"}, {"url": "CanvasLoader.html#method_setFPS", "access": "", "host": "CanvasLoader", "type": "method", "name": "setFPS"}, {"url": "CanvasLoader.html#method_setRange", "access": "", "host": "CanvasLoader", "type": "method", "name": "setRange"}, {"url": "CanvasLoader.html#method_setShape", "access": "", "host": "CanvasLoader", "type": "method", "name": "setShape"}, {"url": "CanvasLoader.html#method_setSpeed", "access": "", "host": "CanvasLoader", "type": "method", "name": "setSpeed"}, {"url": "CanvasLoader.html#property_shape", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "shape"}, {"url": "CanvasLoader.html#method_show", "access": "", "host": "CanvasLoader", "type": "method", "name": "show"}, {"url": "CanvasLoader.html#property_speed", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "speed"}, {"url": "CanvasLoader.html#method_tick", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "tick"}, {"url": "CanvasLoader.html#property_timer", "access": "protected", "host": "CanvasLoader", "type": "property", "name": "timer"}, {"url": "CanvasLoader.html#method_transCon", "access": "protected", "host": "CanvasLoader", "type": "method", "name": "transCon"}];
</script>
</body>
</html>