Bitmap Fonts added
Docs updated
This commit is contained in:
parent
ae98487b16
commit
b378c1ab85
68 changed files with 12469 additions and 3614 deletions
|
@ -3,9 +3,12 @@ YUI.add("yuidoc-meta", function(Y) {
|
|||
"classes": [
|
||||
"AssetLoader",
|
||||
"BaseTexture",
|
||||
"BitmapFontLoader",
|
||||
"BitmapText",
|
||||
"CanvasRenderer",
|
||||
"DisplayObject",
|
||||
"DisplayObjectContainer",
|
||||
"ImageLoader",
|
||||
"InteractionData",
|
||||
"InteractionManager",
|
||||
"MovieClip",
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -146,9 +152,9 @@
|
|||
|
||||
|
||||
<div class="box intro">
|
||||
<p>A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
|
||||
When all items have been loaded this class will dispatch a 'loaded' event
|
||||
As each individual item is loaded this class will dispatch a 'progress' event</p>
|
||||
<p>A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage()
|
||||
When all items have been loaded this class will dispatch a "onLoaded" event
|
||||
As each individual item is loaded this class will dispatch a "onProgress" event</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -225,7 +231,7 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
<p>an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time</p>
|
||||
<p>an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time. Supported bitmap font data formats include "xml" and "fnt".</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -391,7 +397,7 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_loaders_AssetLoader.js.html#l35"><code>src/pixi/loaders/AssetLoader.js:35</code></a>
|
||||
<a href="../files/src_pixi_loaders_AssetLoader.js.html#l43"><code>src/pixi/loaders/AssetLoader.js:43</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -434,7 +440,7 @@ As each individual item is loaded this class will dispatch a 'progress' event</p
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_loaders_AssetLoader.js.html#l30"><code>src/pixi/loaders/AssetLoader.js:30</code></a>
|
||||
<a href="../files/src_pixi_loaders_AssetLoader.js.html#l38"><code>src/pixi/loaders/AssetLoader.js:38</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
322
docs/classes/BitmapFontLoader.html
Normal file
322
docs/classes/BitmapFontLoader.html
Normal file
|
@ -0,0 +1,322 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>BitmapFontLoader - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1>BitmapFontLoader Class</h1>
|
||||
<div class="box meta">
|
||||
|
||||
|
||||
|
||||
<div class="extends">
|
||||
Extends EventTarget
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_loaders_BitmapFontLoader.js.html#l5"><code>src/pixi/loaders/BitmapFontLoader.js:5</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
Module: <a href="../modules/PIXI.html">PIXI</a>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="box intro">
|
||||
<p>The xml loader is used to load in XML bitmap font data ("xml" or "fnt")
|
||||
To generate the data you can use http://www.angelcode.com/products/bmfont/
|
||||
This loader will also load the image file as the data.
|
||||
When loaded this class will dispatch a "loaded" event</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="constructor">
|
||||
<h2>Constructor</h2>
|
||||
<div id="method_BitmapFontLoader" class="method item">
|
||||
<h3 class="name"><code>BitmapFontLoader</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>url</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>crossorigin</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_loaders_BitmapFontLoader.js.html#l5"><code>src/pixi/loaders/BitmapFontLoader.js:5</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">url</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the url of the sprite sheet JSON file</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">crossorigin</code>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="classdocs" class="tabview">
|
||||
<ul class="api-class-tabs">
|
||||
<li class="api-class-tab index"><a href="#index">Index</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<div id="index" class="api-class-tabpanel index">
|
||||
<h2 class="off-left">Item Index</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
2496
docs/classes/BitmapText.html
Normal file
2496
docs/classes/BitmapText.html
Normal file
File diff suppressed because it is too large
Load diff
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
321
docs/classes/ImageLoader.html
Normal file
321
docs/classes/ImageLoader.html
Normal file
|
@ -0,0 +1,321 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ImageLoader - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1>ImageLoader Class</h1>
|
||||
<div class="box meta">
|
||||
|
||||
|
||||
|
||||
<div class="extends">
|
||||
Extends EventTarget
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_loaders_ImageLoader.js.html#l5"><code>src/pixi/loaders/ImageLoader.js:5</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
Module: <a href="../modules/PIXI.html">PIXI</a>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="box intro">
|
||||
<p>The image loader class is responsible for loading images file formats ("jpeg", "jpg", "png" and "gif")
|
||||
Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
|
||||
When loaded this class will dispatch a 'loaded' event</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="constructor">
|
||||
<h2>Constructor</h2>
|
||||
<div id="method_ImageLoader" class="method item">
|
||||
<h3 class="name"><code>ImageLoader</code></h3>
|
||||
|
||||
|
||||
<div class="args">
|
||||
<span class="paren">(</span><ul class="args-list inline commas">
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>url</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>crossorigin</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="meta">
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Defined in
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_loaders_ImageLoader.js.html#l5"><code>src/pixi/loaders/ImageLoader.js:5</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="params">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">url</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>The url of the image</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">crossorigin</code>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="classdocs" class="tabview">
|
||||
<ul class="api-class-tabs">
|
||||
<li class="api-class-tab index"><a href="#index">Index</a></li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<div id="index" class="api-class-tabpanel index">
|
||||
<h2 class="off-left">Item Index</h2>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -149,10 +155,10 @@
|
|||
<p>The sprite sheet loader is used to load in JSON sprite sheet data
|
||||
To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
|
||||
There is a free version so thats nice, although the paid version is great value for money.
|
||||
It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
|
||||
It is highly recommended to use Sprite sheets (also know as texture atlas") as it means sprite"s can be batched and drawn together for highly increased rendering speed.
|
||||
Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
|
||||
This loader will also load the image file that the Spritesheet points to as well as the data.
|
||||
When loaded this class will dispatch a 'loaded' event</p>
|
||||
When loaded this class will dispatch a "loaded" event</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -171,6 +177,12 @@ When loaded this class will dispatch a 'loaded' event</p>
|
|||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>crossorigin</code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul><span class="paren">)</span>
|
||||
</div>
|
||||
|
||||
|
@ -235,6 +247,21 @@ When loaded this class will dispatch a 'loaded' event</p>
|
|||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">crossorigin</code>
|
||||
<span class="type">Boolean</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -130,7 +136,7 @@
|
|||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_Text.js.html#l5"><code>src/pixi/Text.js:5</code></a>
|
||||
Defined in: <a href="../files/src_pixi_text_Text.js.html#l5"><code>src/pixi/text/Text.js:5</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -146,7 +152,7 @@
|
|||
|
||||
|
||||
<div class="box intro">
|
||||
<p>A Text Object will create a line of text</p>
|
||||
<p>A Text Object will create a line(s) of text to split a line you can use "\n"</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -167,25 +173,7 @@
|
|||
|
||||
<li class="arg">
|
||||
|
||||
<code>fontStyle</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>fillStyle</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>strokeStyle</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>strokeThickness</code>
|
||||
<code class="optional">[style]</code>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -218,7 +206,7 @@
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_Text.js.html#l5"><code>src/pixi/Text.js:5</code></a>
|
||||
<a href="../files/src_pixi_text_Text.js.html#l5"><code>src/pixi/text/Text.js:5</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -255,61 +243,91 @@
|
|||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">fontStyle</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the style and size of the font eg "bold 20px Arial"</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">fillStyle</code>
|
||||
<code class="param-name optional">[style]</code>
|
||||
<span class="type">Object</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>a canvas fillstyle that will be used on the text eg "red", "#00FF00" can also be null</p>
|
||||
<p>The style parameters</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">strokeStyle</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[font]</code>
|
||||
<span class="type">String</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>default "bold 20pt Arial" The style and size of the font</p>
|
||||
</div>
|
||||
|
||||
<div class="param-description">
|
||||
<p>a canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" can also be null</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[fill="black"]</code>
|
||||
<span class="type">Object</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">strokeThickness</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
<div class="param-description">
|
||||
<p>A canvas fillstyle that will be used on the text eg "red", "#00FF00"</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[align="left"]</code>
|
||||
<span class="type">String</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A number that represents the thicknes of the stroke. default is 0 (no stroke)</p>
|
||||
</div>
|
||||
<div class="param-description">
|
||||
<p>An alignment of the multiline text ("left", "center" or "right")</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[stroke]</code>
|
||||
<span class="type">String</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00"</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[strokeThickness=0]</code>
|
||||
<span class="type">Number</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A number that represents the thickness of the stroke. Default is 0 (no stroke)</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -672,7 +690,7 @@
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -762,7 +780,7 @@
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -777,7 +795,7 @@
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -945,7 +963,7 @@
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1451,7 +1469,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1560,25 +1578,13 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
<li class="arg">
|
||||
|
||||
<code>fontStyle</code>
|
||||
<code class="optional">[style]</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>fillStyle</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>strokeStyle</code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="arg">
|
||||
|
||||
<code>strokeThickness</code>
|
||||
<code>[style.font="bold</code>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -1611,7 +1617,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
|
||||
<a href="../files/src_pixi_Text.js.html#l47"><code>src/pixi/Text.js:47</code></a>
|
||||
<a href="../files/src_pixi_text_Text.js.html#l34"><code>src/pixi/text/Text.js:34</code></a>
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -1633,59 +1639,90 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">fontStyle</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>the style and size of the font eg "bold 20px Arial"</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">fillStyle</code>
|
||||
<code class="param-name optional">[style]</code>
|
||||
<span class="type">Object</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>a canvas fillstyle that will be used on the text eg "red", "#00FF00" can also be null</p>
|
||||
<p>The style parameters</p>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="params-list">
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[fill="black"]</code>
|
||||
<span class="type">Object</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A canvas fillstyle that will be used on the text eg "red", "#00FF00"</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[align="left"]</code>
|
||||
<span class="type">String</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>An alignment of the multiline text ("left", "center" or "right")</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[stroke]</code>
|
||||
<span class="type">String</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00"</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name optional">[strokeThickness=0]</code>
|
||||
<span class="type">Number</span>
|
||||
<span class="flag optional" title="This parameter is optional.">optional</span>
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A number that represents the thickness of the stroke. Default is 0 (no stroke)</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">strokeStyle</code>
|
||||
<code class="param-name">[style.font="bold</code>
|
||||
<span class="type">String</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>a canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" can also be null</p>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="param">
|
||||
|
||||
<code class="param-name">strokeThickness</code>
|
||||
<span class="type">Number</span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="param-description">
|
||||
<p>A number that represents the thicknes of the stroke. default is 0 (no stroke)</p>
|
||||
<p>20pt Arial"] The style and size of the font</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1859,7 +1896,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -1874,7 +1911,7 @@ for this callback to be fired, The touch must have started over the displayObjec
|
|||
|
||||
|
||||
<div class="param-description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
706
docs/data.json
706
docs/data.json
|
@ -39,6 +39,24 @@
|
|||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/loaders/BitmapFontLoader.js": {
|
||||
"name": "src/pixi/loaders/BitmapFontLoader.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"BitmapFontLoader": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/loaders/ImageLoader.js": {
|
||||
"name": "src/pixi/loaders/ImageLoader.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"ImageLoader": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/loaders/SpriteSheetLoader.js": {
|
||||
"name": "src/pixi/loaders/SpriteSheetLoader.js",
|
||||
"modules": {},
|
||||
|
@ -82,6 +100,24 @@
|
|||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/text/BitmapText.js": {
|
||||
"name": "src/pixi/text/BitmapText.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"BitmapText": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/text/Text.js": {
|
||||
"name": "src/pixi/text/Text.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"Text": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/textures/BaseTexture.js": {
|
||||
"name": "src/pixi/textures/BaseTexture.js",
|
||||
"modules": {},
|
||||
|
@ -149,6 +185,13 @@
|
|||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/Intro.js": {
|
||||
"name": "src/pixi/Intro.js",
|
||||
"modules": {},
|
||||
"classes": {},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/MovieClip.js": {
|
||||
"name": "src/pixi/MovieClip.js",
|
||||
"modules": {},
|
||||
|
@ -158,6 +201,13 @@
|
|||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/Outro.js": {
|
||||
"name": "src/pixi/Outro.js",
|
||||
"modules": {},
|
||||
"classes": {},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/Pixi.js": {
|
||||
"name": "src/pixi/Pixi.js",
|
||||
"modules": {
|
||||
|
@ -202,15 +252,6 @@
|
|||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
},
|
||||
"src/pixi/Text.js": {
|
||||
"name": "src/pixi/Text.js",
|
||||
"modules": {},
|
||||
"classes": {
|
||||
"Text": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {}
|
||||
}
|
||||
},
|
||||
"modules": {
|
||||
|
@ -220,10 +261,14 @@
|
|||
"classes": {
|
||||
"TilingSprite": 1,
|
||||
"AssetLoader": 1,
|
||||
"BitmapFontLoader": 1,
|
||||
"ImageLoader": 1,
|
||||
"SpriteSheetLoader": 1,
|
||||
"CanvasRenderer": 1,
|
||||
"WebGLBatch": 1,
|
||||
"WebGLRenderer": 1,
|
||||
"BitmapText": 1,
|
||||
"Text": 1,
|
||||
"BaseTexture": 1,
|
||||
"Texture": 1,
|
||||
"DisplayObject": 1,
|
||||
|
@ -234,13 +279,12 @@
|
|||
"Point": 1,
|
||||
"Rectangle": 1,
|
||||
"Sprite": 1,
|
||||
"Stage": 1,
|
||||
"Text": 1
|
||||
"Stage": 1
|
||||
},
|
||||
"fors": {},
|
||||
"namespaces": {},
|
||||
"tag": "module",
|
||||
"file": "src/pixi/Text.js",
|
||||
"file": "src/pixi/Stage.js",
|
||||
"line": 5
|
||||
}
|
||||
},
|
||||
|
@ -288,17 +332,71 @@
|
|||
"module": "PIXI",
|
||||
"file": "src/pixi/loaders/AssetLoader.js",
|
||||
"line": 5,
|
||||
"description": "A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()\nWhen all items have been loaded this class will dispatch a 'loaded' event\nAs each individual item is loaded this class will dispatch a 'progress' event",
|
||||
"description": "A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage()\nWhen all items have been loaded this class will dispatch a \"onLoaded\" event\nAs each individual item is loaded this class will dispatch a \"onProgress\" event",
|
||||
"is_constructor": 1,
|
||||
"extends": "EventTarget",
|
||||
"params": [
|
||||
{
|
||||
"name": "assetURLs",
|
||||
"description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time",
|
||||
"description": "an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include \"jpeg\", \"jpg\", \"png\", \"gif\". Supported sprite sheet data formats only include \"JSON\" at this time. Supported bitmap font data formats include \"xml\" and \"fnt\".",
|
||||
"type": "Array"
|
||||
}
|
||||
]
|
||||
},
|
||||
"BitmapFontLoader": {
|
||||
"name": "BitmapFontLoader",
|
||||
"shortname": "BitmapFontLoader",
|
||||
"classitems": [],
|
||||
"plugins": [],
|
||||
"extensions": [],
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/loaders/BitmapFontLoader.js",
|
||||
"line": 5,
|
||||
"description": "The xml loader is used to load in XML bitmap font data (\"xml\" or \"fnt\")\nTo generate the data you can use http://www.angelcode.com/products/bmfont/\nThis loader will also load the image file as the data.\nWhen loaded this class will dispatch a \"loaded\" event",
|
||||
"extends": "EventTarget",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "url",
|
||||
"description": "the url of the sprite sheet JSON file",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "crossorigin",
|
||||
"description": "",
|
||||
"type": "Boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ImageLoader": {
|
||||
"name": "ImageLoader",
|
||||
"shortname": "ImageLoader",
|
||||
"classitems": [],
|
||||
"plugins": [],
|
||||
"extensions": [],
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/loaders/ImageLoader.js",
|
||||
"line": 5,
|
||||
"description": "The image loader class is responsible for loading images file formats (\"jpeg\", \"jpg\", \"png\" and \"gif\")\nOnce the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nWhen loaded this class will dispatch a 'loaded' event",
|
||||
"extends": "EventTarget",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "url",
|
||||
"description": "The url of the image",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "crossorigin",
|
||||
"description": "",
|
||||
"type": "Boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SpriteSheetLoader": {
|
||||
"name": "SpriteSheetLoader",
|
||||
"shortname": "SpriteSheetLoader",
|
||||
|
@ -310,7 +408,7 @@
|
|||
"module": "PIXI",
|
||||
"file": "src/pixi/loaders/SpriteSheetLoader.js",
|
||||
"line": 5,
|
||||
"description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event",
|
||||
"description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the \"JSON\" format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas\") as it means sprite\"s can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a \"loaded\" event",
|
||||
"extends": "EventTarget",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
|
@ -318,6 +416,11 @@
|
|||
"name": "url",
|
||||
"description": "the url of the sprite sheet JSON file",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "crossorigin",
|
||||
"description": "",
|
||||
"type": "Boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -418,6 +521,112 @@
|
|||
],
|
||||
"default": "false"
|
||||
},
|
||||
"BitmapText": {
|
||||
"name": "BitmapText",
|
||||
"shortname": "BitmapText",
|
||||
"classitems": [],
|
||||
"plugins": [],
|
||||
"extensions": [],
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/text/BitmapText.js",
|
||||
"line": 5,
|
||||
"description": "A Text Object will create a line(s) of text using bitmap font \nYou can generate the fnt files using \nhttp://www.angelcode.com/products/bmfont/ for windows of\nhttp://www.bmglyph.com/ for mac.",
|
||||
"extends": "DisplayObjectContainer",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "text",
|
||||
"description": "The copy that you would like the text to display",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "style",
|
||||
"description": "The style parameters",
|
||||
"type": "Object",
|
||||
"optional": true,
|
||||
"props": [
|
||||
{
|
||||
"name": "font",
|
||||
"description": "default is \"20pt Arial\" The size and bitmap font id (must have loaded previously)",
|
||||
"type": "String",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "align",
|
||||
"description": "An alignment of the multiline text (\"left\", \"center\" or \"right\")",
|
||||
"type": "String",
|
||||
"optional": true,
|
||||
"optdefault": "\"left\""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Text": {
|
||||
"name": "Text",
|
||||
"shortname": "Text",
|
||||
"classitems": [],
|
||||
"plugins": [],
|
||||
"extensions": [],
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 5,
|
||||
"description": "A Text Object will create a line(s) of text to split a line you can use \"\\n\"",
|
||||
"extends": "Sprite",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "text",
|
||||
"description": "The copy that you would like the text to display",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "style",
|
||||
"description": "The style parameters",
|
||||
"type": "Object",
|
||||
"optional": true,
|
||||
"props": [
|
||||
{
|
||||
"name": "font",
|
||||
"description": "default \"bold 20pt Arial\" The style and size of the font",
|
||||
"type": "String",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "fill",
|
||||
"description": "A canvas fillstyle that will be used on the text eg \"red\", \"#00FF00\"",
|
||||
"type": "Object",
|
||||
"optional": true,
|
||||
"optdefault": "\"black\""
|
||||
},
|
||||
{
|
||||
"name": "align",
|
||||
"description": "An alignment of the multiline text (\"left\", \"center\" or \"right\")",
|
||||
"type": "String",
|
||||
"optional": true,
|
||||
"optdefault": "\"left\""
|
||||
},
|
||||
{
|
||||
"name": "stroke",
|
||||
"description": "A canvas fillstyle that will be used on the text stroke eg \"blue\", \"#FCFF00\"",
|
||||
"type": "String",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "strokeThickness",
|
||||
"description": "A number that represents the thickness of the stroke. Default is 0 (no stroke)",
|
||||
"type": "Number",
|
||||
"optional": true,
|
||||
"optdefault": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"BaseTexture": {
|
||||
"name": "BaseTexture",
|
||||
"shortname": "BaseTexture",
|
||||
|
@ -667,49 +876,6 @@
|
|||
"type": "Boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Text": {
|
||||
"name": "Text",
|
||||
"shortname": "Text",
|
||||
"classitems": [],
|
||||
"plugins": [],
|
||||
"extensions": [],
|
||||
"plugin_for": [],
|
||||
"extension_for": [],
|
||||
"module": "PIXI",
|
||||
"namespace": "",
|
||||
"file": "src/pixi/Text.js",
|
||||
"line": 5,
|
||||
"description": "A Text Object will create a line of text",
|
||||
"extends": "Sprite",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "text",
|
||||
"description": "The copy that you would like the text to display",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "fontStyle",
|
||||
"description": "the style and size of the font eg \"bold 20px Arial\"",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "fillStyle",
|
||||
"description": "a canvas fillstyle that will be used on the text eg \"red\", \"#00FF00\" can also be null",
|
||||
"type": "Object"
|
||||
},
|
||||
{
|
||||
"name": "strokeStyle",
|
||||
"description": "a canvas fillstyle that will be used on the text stroke eg \"blue\", \"#FCFF00\" can also be null",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "strokeThickness",
|
||||
"description": "A number that represents the thicknes of the stroke. default is 0 (no stroke)",
|
||||
"type": "Number"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"classitems": [
|
||||
|
@ -766,7 +932,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/AssetLoader.js",
|
||||
"line": 30,
|
||||
"line": 38,
|
||||
"description": "Fired when an item has loaded",
|
||||
"itemtype": "event",
|
||||
"name": "onProgress",
|
||||
|
@ -774,7 +940,7 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/AssetLoader.js",
|
||||
"line": 35,
|
||||
"line": 43,
|
||||
"description": "Fired when all the assets have loaded",
|
||||
"itemtype": "event",
|
||||
"name": "onComplete",
|
||||
|
@ -782,10 +948,66 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/AssetLoader.js",
|
||||
"line": 43,
|
||||
"line": 51,
|
||||
"description": "This will begin loading the assets sequentially",
|
||||
"class": "AssetLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/AssetLoader.js",
|
||||
"line": 79,
|
||||
"description": "Invoked after each file is loaded",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "AssetLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/BitmapFontLoader.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "BitmapFontLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/BitmapFontLoader.js",
|
||||
"line": 34,
|
||||
"description": "This will begin loading the JSON file",
|
||||
"class": "BitmapFontLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/BitmapFontLoader.js",
|
||||
"line": 51,
|
||||
"description": "Invoked when XML file is loaded",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "BitmapFontLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/BitmapFontLoader.js",
|
||||
"line": 118,
|
||||
"description": "Invoked when all files are loaded (xml/fnt and texture)",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "BitmapFontLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/ImageLoader.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "ImageLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/ImageLoader.js",
|
||||
"line": 24,
|
||||
"description": "Loads image or takes it from cache",
|
||||
"class": "ImageLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/ImageLoader.js",
|
||||
"line": 43,
|
||||
"description": "Invoked when image file is loaded or it is already cached and ready to use",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "ImageLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/SpriteSheetLoader.js",
|
||||
"line": 1,
|
||||
|
@ -794,10 +1016,26 @@
|
|||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/SpriteSheetLoader.js",
|
||||
"line": 37,
|
||||
"line": 38,
|
||||
"description": "This will begin loading the JSON file",
|
||||
"class": "SpriteSheetLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/SpriteSheetLoader.js",
|
||||
"line": 55,
|
||||
"description": "Invoke when JSON file is loaded",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "SpriteSheetLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/loaders/SpriteSheetLoader.js",
|
||||
"line": 97,
|
||||
"description": "Invoke when all files are loaded (json and texture)",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "SpriteSheetLoader"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/renderers/CanvasRenderer.js",
|
||||
"line": 1,
|
||||
|
@ -1205,7 +1443,165 @@
|
|||
"file": "src/pixi/renderers/WebGLShaders.js",
|
||||
"line": 2,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "BaseTexture"
|
||||
"class": "BitmapText"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/BitmapText.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "BitmapText"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/BitmapText.js",
|
||||
"line": 34,
|
||||
"description": "Set the copy for the text object",
|
||||
"methos": "setText",
|
||||
"params": [
|
||||
{
|
||||
"name": "text",
|
||||
"description": "The copy that you would like the text to display",
|
||||
"type": "String"
|
||||
}
|
||||
],
|
||||
"class": "BitmapText"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/BitmapText.js",
|
||||
"line": 45,
|
||||
"description": "Set the style of the text",
|
||||
"itemtype": "method",
|
||||
"name": "setStyle",
|
||||
"params": [
|
||||
{
|
||||
"name": "style",
|
||||
"description": "The style parameters",
|
||||
"type": "Object",
|
||||
"optional": true,
|
||||
"props": [
|
||||
{
|
||||
"name": "font",
|
||||
"description": "The style and size of the font. If font size is not specified, it uses default bitmap font size. Font name is required",
|
||||
"type": "Object"
|
||||
},
|
||||
{
|
||||
"name": "align",
|
||||
"description": "An alignment of the multiline text (\"left\", \"center\" or \"right\")",
|
||||
"type": "String",
|
||||
"optional": true,
|
||||
"optdefault": "\"left\""
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"class": "BitmapText"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/BitmapText.js",
|
||||
"line": 65,
|
||||
"description": "Renders text",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "BitmapText"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/BitmapText.js",
|
||||
"line": 138,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "BitmapText"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "Text"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 34,
|
||||
"description": "Set the style of the text",
|
||||
"itemtype": "method",
|
||||
"name": "setStyle",
|
||||
"params": [
|
||||
{
|
||||
"name": "style",
|
||||
"description": "The style parameters",
|
||||
"type": "Object",
|
||||
"optional": true,
|
||||
"props": [
|
||||
{
|
||||
"name": "fill",
|
||||
"description": "A canvas fillstyle that will be used on the text eg \"red\", \"#00FF00\"",
|
||||
"type": "Object",
|
||||
"optional": true,
|
||||
"optdefault": "\"black\""
|
||||
},
|
||||
{
|
||||
"name": "align",
|
||||
"description": "An alignment of the multiline text (\"left\", \"center\" or \"right\")",
|
||||
"type": "String",
|
||||
"optional": true,
|
||||
"optdefault": "\"left\""
|
||||
},
|
||||
{
|
||||
"name": "stroke",
|
||||
"description": "A canvas fillstyle that will be used on the text stroke eg \"blue\", \"#FCFF00\"",
|
||||
"type": "String",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "strokeThickness",
|
||||
"description": "A number that represents the thickness of the stroke. Default is 0 (no stroke)",
|
||||
"type": "Number",
|
||||
"optional": true,
|
||||
"optdefault": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "[style.font=\"bold",
|
||||
"description": "20pt Arial\"] The style and size of the font",
|
||||
"type": "String"
|
||||
}
|
||||
],
|
||||
"class": "Text"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 55,
|
||||
"description": "Set the copy for the text object. To split a line you can use \"\\n\"",
|
||||
"methos": "setText",
|
||||
"params": [
|
||||
{
|
||||
"name": "text",
|
||||
"description": "The copy that you would like the text to display",
|
||||
"type": "String"
|
||||
}
|
||||
],
|
||||
"class": "Text"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 66,
|
||||
"description": "Renders text",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "Text"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 129,
|
||||
"description": "Updates texture size based on canvas size",
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "Text"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/text/Text.js",
|
||||
"line": 143,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "Text"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/textures/BaseTexture.js",
|
||||
|
@ -1885,6 +2281,12 @@
|
|||
},
|
||||
"class": "InteractionData"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Intro.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "MovieClip"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/MovieClip.js",
|
||||
"line": 1,
|
||||
|
@ -1991,6 +2393,12 @@
|
|||
],
|
||||
"class": "MovieClip"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Outro.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "Point"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Pixi.js",
|
||||
"line": 1,
|
||||
|
@ -2257,68 +2665,6 @@
|
|||
},
|
||||
"class": "Stage",
|
||||
"module": "PIXI"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Text.js",
|
||||
"line": 1,
|
||||
"author": "Mat Groves http://matgroves.com/ @Doormat23",
|
||||
"class": "Text",
|
||||
"module": "PIXI"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Text.js",
|
||||
"line": 36,
|
||||
"description": "Set the copy for the text object",
|
||||
"methos": "setText",
|
||||
"params": [
|
||||
{
|
||||
"name": "text",
|
||||
"description": "The copy that you would like the text to display",
|
||||
"type": "String"
|
||||
}
|
||||
],
|
||||
"class": "Text",
|
||||
"module": "PIXI"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Text.js",
|
||||
"line": 47,
|
||||
"description": "Set the style of the text",
|
||||
"itemtype": "method",
|
||||
"name": "setStyle",
|
||||
"is_constructor": 1,
|
||||
"params": [
|
||||
{
|
||||
"name": "fontStyle",
|
||||
"description": "the style and size of the font eg \"bold 20px Arial\"",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "fillStyle",
|
||||
"description": "a canvas fillstyle that will be used on the text eg \"red\", \"#00FF00\" can also be null",
|
||||
"type": "Object"
|
||||
},
|
||||
{
|
||||
"name": "strokeStyle",
|
||||
"description": "a canvas fillstyle that will be used on the text stroke eg \"blue\", \"#FCFF00\" can also be null",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"name": "strokeThickness",
|
||||
"description": "A number that represents the thicknes of the stroke. default is 0 (no stroke)",
|
||||
"type": "Number"
|
||||
}
|
||||
],
|
||||
"class": "Text",
|
||||
"module": "PIXI"
|
||||
},
|
||||
{
|
||||
"file": "src/pixi/Text.js",
|
||||
"line": 66,
|
||||
"access": "private",
|
||||
"tagname": "",
|
||||
"class": "Text",
|
||||
"module": "PIXI"
|
||||
}
|
||||
],
|
||||
"warnings": [
|
||||
|
@ -2327,12 +2673,16 @@
|
|||
"line": " src/pixi/renderers/WebGLBatch.js:292"
|
||||
},
|
||||
{
|
||||
"message": "unknown tag: internal",
|
||||
"line": " src/pixi/Stage.js:37"
|
||||
"message": "unknown tag: methos",
|
||||
"line": " src/pixi/text/BitmapText.js:34"
|
||||
},
|
||||
{
|
||||
"message": "unknown tag: methos",
|
||||
"line": " src/pixi/Text.js:36"
|
||||
"line": " src/pixi/text/Text.js:55"
|
||||
},
|
||||
{
|
||||
"message": "unknown tag: internal",
|
||||
"line": " src/pixi/Stage.js:37"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2352,7 +2702,39 @@
|
|||
},
|
||||
{
|
||||
"message": "Missing item type\nThis will begin loading the assets sequentially",
|
||||
"line": " src/pixi/loaders/AssetLoader.js:43"
|
||||
"line": " src/pixi/loaders/AssetLoader.js:51"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nInvoked after each file is loaded",
|
||||
"line": " src/pixi/loaders/AssetLoader.js:79"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/loaders/BitmapFontLoader.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nThis will begin loading the JSON file",
|
||||
"line": " src/pixi/loaders/BitmapFontLoader.js:34"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nInvoked when XML file is loaded",
|
||||
"line": " src/pixi/loaders/BitmapFontLoader.js:51"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nInvoked when all files are loaded (xml/fnt and texture)",
|
||||
"line": " src/pixi/loaders/BitmapFontLoader.js:118"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/loaders/ImageLoader.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nLoads image or takes it from cache",
|
||||
"line": " src/pixi/loaders/ImageLoader.js:24"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nInvoked when image file is loaded or it is already cached and ready to use",
|
||||
"line": " src/pixi/loaders/ImageLoader.js:43"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2360,7 +2742,15 @@
|
|||
},
|
||||
{
|
||||
"message": "Missing item type\nThis will begin loading the JSON file",
|
||||
"line": " src/pixi/loaders/SpriteSheetLoader.js:37"
|
||||
"line": " src/pixi/loaders/SpriteSheetLoader.js:38"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nInvoke when JSON file is loaded",
|
||||
"line": " src/pixi/loaders/SpriteSheetLoader.js:55"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nInvoke when all files are loaded (json and texture)",
|
||||
"line": " src/pixi/loaders/SpriteSheetLoader.js:97"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
|
@ -2470,6 +2860,42 @@
|
|||
"message": "Missing item type",
|
||||
"line": " src/pixi/renderers/WebGLShaders.js:2"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/text/BitmapText.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nSet the copy for the text object",
|
||||
"line": " src/pixi/text/BitmapText.js:34"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nRenders text",
|
||||
"line": " src/pixi/text/BitmapText.js:65"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/text/BitmapText.js:138"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/text/Text.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nSet the copy for the text object. To split a line you can use \"\\n\"",
|
||||
"line": " src/pixi/text/Text.js:55"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nRenders text",
|
||||
"line": " src/pixi/text/Text.js:66"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nUpdates texture size based on canvas size",
|
||||
"line": " src/pixi/text/Text.js:129"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/text/Text.js:143"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/textures/BaseTexture.js:1"
|
||||
|
@ -2514,10 +2940,18 @@
|
|||
"message": "Missing item type",
|
||||
"line": " src/pixi/InteractionManager.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/Intro.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/MovieClip.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/Outro.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/Pixi.js:1"
|
||||
|
@ -2541,18 +2975,6 @@
|
|||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/Stage.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/Text.js:1"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type\nSet the copy for the text object",
|
||||
"line": " src/pixi/Text.js:36"
|
||||
},
|
||||
{
|
||||
"message": "Missing item type",
|
||||
"line": " src/pixi/Text.js:66"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
157
docs/files/src_pixi_Intro.js.html
Normal file
157
docs/files/src_pixi_Intro.js.html
Normal file
|
@ -0,0 +1,157 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/Intro.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/Intro.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
(function(){
|
||||
|
||||
var root = this;
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
164
docs/files/src_pixi_Outro.js.html
Normal file
164
docs/files/src_pixi_Outro.js.html
Normal file
|
@ -0,0 +1,164 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/Outro.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/Outro.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
if (typeof exports !== 'undefined') {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
exports = module.exports = PIXI;
|
||||
}
|
||||
exports.PIXI = PIXI;
|
||||
} else {
|
||||
root.PIXI = PIXI;
|
||||
}
|
||||
|
||||
|
||||
}).call(this);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -127,17 +133,17 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* A Class that loads a bunch of images / sprite sheet files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromFrame(), PIXI.Texture.fromImage() and PIXI.Sprite.fromImage(), PIXI.Sprite.fromFromeId()
|
||||
* When all items have been loaded this class will dispatch a 'loaded' event
|
||||
* As each individual item is loaded this class will dispatch a 'progress' event
|
||||
* A Class that loads a bunch of images / sprite sheet / bitmap font files. Once the assets have been loaded they are added to the PIXI Texture cache and can be accessed easily through PIXI.Texture.fromImage() and PIXI.Sprite.fromImage()
|
||||
* When all items have been loaded this class will dispatch a "onLoaded" event
|
||||
* As each individual item is loaded this class will dispatch a "onProgress" event
|
||||
* @class AssetLoader
|
||||
* @constructor
|
||||
* @extends EventTarget
|
||||
* @param assetURLs {Array} an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time
|
||||
* @param {Array} assetURLs an array of image/sprite sheet urls that you would like loaded supported. Supported image formats include "jpeg", "jpg", "png", "gif". Supported sprite sheet data formats only include "JSON" at this time. Supported bitmap font data formats include "xml" and "fnt".
|
||||
*/
|
||||
PIXI.AssetLoader = function(assetURLs)
|
||||
{
|
||||
PIXI.EventTarget.call( this );
|
||||
PIXI.EventTarget.call(this);
|
||||
|
||||
/**
|
||||
* The array of asset URLs that are going to be loaded
|
||||
|
@ -145,11 +151,19 @@ PIXI.AssetLoader = function(assetURLs)
|
|||
* @type Array
|
||||
*/
|
||||
this.assetURLs = assetURLs;
|
||||
|
||||
this.assets = [];
|
||||
|
||||
this.crossorigin = false;
|
||||
}
|
||||
|
||||
this.loadersByType = {
|
||||
"jpg": PIXI.ImageLoader,
|
||||
"jpeg": PIXI.ImageLoader,
|
||||
"png": PIXI.ImageLoader,
|
||||
"gif": PIXI.ImageLoader,
|
||||
"json": PIXI.SpriteSheetLoader,
|
||||
"xml": PIXI.BitmapFontLoader,
|
||||
"fnt": PIXI.BitmapFontLoader
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
Fired when an item has loaded
|
||||
|
@ -169,105 +183,45 @@ PIXI.AssetLoader.constructor = PIXI.AssetLoader;
|
|||
*/
|
||||
PIXI.AssetLoader.prototype.load = function()
|
||||
{
|
||||
this.loadCount = this.assetURLs.length;
|
||||
var imageTypes = ["jpeg", "jpg", "png", "gif"];
|
||||
|
||||
var spriteSheetTypes = ["json"];
|
||||
|
||||
for (var i=0; i < this.assetURLs.length; i++)
|
||||
{
|
||||
var filename = this.assetURLs[i];
|
||||
var fileType = filename.split('.').pop().toLowerCase();
|
||||
// what are we loading?
|
||||
var type = null;
|
||||
|
||||
for (var j=0; j < imageTypes.length; j++)
|
||||
{
|
||||
if(fileType == imageTypes[j])
|
||||
{
|
||||
type = "img";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(type != "img")
|
||||
{
|
||||
for (var j=0; j < spriteSheetTypes.length; j++)
|
||||
{
|
||||
if(fileType == spriteSheetTypes[j])
|
||||
{
|
||||
type = "atlas";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(type == "img")
|
||||
{
|
||||
|
||||
var texture = PIXI.Texture.fromImage(filename, this.crossorigin);
|
||||
if(!texture.baseTexture.hasLoaded)
|
||||
{
|
||||
|
||||
var scope = this;
|
||||
texture.baseTexture.addEventListener( 'loaded', function ( event )
|
||||
{
|
||||
scope.onAssetLoaded();
|
||||
});
|
||||
|
||||
this.assets.push(texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// already loaded!
|
||||
this.loadCount--;
|
||||
// if this hits zero here.. then everything was cached!
|
||||
if(this.loadCount == 0)
|
||||
{
|
||||
this.dispatchEvent( { type: 'onComplete', content: this } );
|
||||
if(this.onComplete)this.onComplete();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if(type == "atlas")
|
||||
{
|
||||
var spriteSheetLoader = new PIXI.SpriteSheetLoader(filename);
|
||||
spriteSheetLoader.crossorigin = this.crossorigin;
|
||||
this.assets.push(spriteSheetLoader);
|
||||
|
||||
var scope = this;
|
||||
spriteSheetLoader.addEventListener( 'loaded', function ( event )
|
||||
{
|
||||
scope.onAssetLoaded();
|
||||
});
|
||||
|
||||
spriteSheetLoader.load();
|
||||
}
|
||||
else
|
||||
{
|
||||
// dont know what the file is! :/
|
||||
//this.loadCount--;
|
||||
throw new Error(filename + " is an unsupported file type " + this);
|
||||
}
|
||||
|
||||
//this.assets[i].load();
|
||||
};
|
||||
}
|
||||
var scope = this;
|
||||
|
||||
this.loadCount = this.assetURLs.length;
|
||||
|
||||
for (var i=0; i < this.assetURLs.length; i++)
|
||||
{
|
||||
var fileName = this.assetURLs[i];
|
||||
var fileType = fileName.split(".").pop().toLowerCase();
|
||||
|
||||
var loaderClass = this.loadersByType[fileType];
|
||||
if(!loaderClass)
|
||||
throw new Error(fileType + " is an unsupported file type");
|
||||
|
||||
var loader = new loaderClass(fileName, this.crossorigin);
|
||||
|
||||
loader.addEventListener("loaded", function()
|
||||
{
|
||||
scope.onAssetLoaded();
|
||||
});
|
||||
loader.load();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoked after each file is loaded
|
||||
* @private
|
||||
*/
|
||||
PIXI.AssetLoader.prototype.onAssetLoaded = function()
|
||||
{
|
||||
this.loadCount--;
|
||||
this.dispatchEvent( { type: 'onProgress', content: this } );
|
||||
if(this.onProgress)this.onProgress();
|
||||
this.loadCount--;
|
||||
this.dispatchEvent({type: "onProgress", content: this});
|
||||
if(this.onProgress) this.onProgress();
|
||||
|
||||
if(this.loadCount == 0)
|
||||
{
|
||||
this.dispatchEvent( { type: 'onComplete', content: this } );
|
||||
if(this.onComplete)this.onComplete();
|
||||
this.dispatchEvent({type: "onComplete", content: this});
|
||||
if(this.onComplete) this.onComplete();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</pre>
|
||||
|
|
275
docs/files/src_pixi_loaders_BitmapFontLoader.js.html
Normal file
275
docs/files/src_pixi_loaders_BitmapFontLoader.js.html
Normal file
|
@ -0,0 +1,275 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/loaders/BitmapFontLoader.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/loaders/BitmapFontLoader.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
/**
|
||||
* The xml loader is used to load in XML bitmap font data ("xml" or "fnt")
|
||||
* To generate the data you can use http://www.angelcode.com/products/bmfont/
|
||||
* This loader will also load the image file as the data.
|
||||
* When loaded this class will dispatch a "loaded" event
|
||||
* @class BitmapFontLoader
|
||||
* @extends EventTarget
|
||||
* @constructor
|
||||
* @param {String} url the url of the sprite sheet JSON file
|
||||
* @param {Boolean} crossorigin
|
||||
*/
|
||||
|
||||
PIXI.BitmapFontLoader = function(url, crossorigin)
|
||||
{
|
||||
/*
|
||||
* i use texture packer to load the assets..
|
||||
* http://www.codeandweb.com/texturepacker
|
||||
* make sure to set the format as "JSON"
|
||||
*/
|
||||
PIXI.EventTarget.call(this);
|
||||
this.url = url;
|
||||
this.baseUrl = url.replace(/[^\/]*$/, "");
|
||||
this.texture = null;
|
||||
this.crossorigin = crossorigin;
|
||||
};
|
||||
|
||||
// constructor
|
||||
PIXI.BitmapFontLoader.constructor = PIXI.BitmapFontLoader;
|
||||
|
||||
/**
|
||||
* This will begin loading the JSON file
|
||||
*/
|
||||
PIXI.BitmapFontLoader.prototype.load = function()
|
||||
{
|
||||
this.ajaxRequest = new XMLHttpRequest();
|
||||
var scope = this;
|
||||
this.ajaxRequest.onreadystatechange = function()
|
||||
{
|
||||
scope.onXMLLoaded();
|
||||
};
|
||||
|
||||
this.ajaxRequest.open("GET", this.url, true);
|
||||
if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType("application/xml");
|
||||
this.ajaxRequest.send(null)
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoked when XML file is loaded
|
||||
* @private
|
||||
*/
|
||||
PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
|
||||
{
|
||||
if (this.ajaxRequest.readyState == 4)
|
||||
{
|
||||
if (this.ajaxRequest.status == 200 || window.location.href.indexOf("http") == -1)
|
||||
{
|
||||
var textureUrl = this.baseUrl + this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue;
|
||||
var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
|
||||
this.texture = image.texture.baseTexture;
|
||||
|
||||
var data = {};
|
||||
var info = this.ajaxRequest.responseXML.getElementsByTagName("info")[0];
|
||||
var common = this.ajaxRequest.responseXML.getElementsByTagName("common")[0];
|
||||
data.font = info.attributes.getNamedItem("face").nodeValue;
|
||||
data.size = parseInt(info.attributes.getNamedItem("size").nodeValue, 10);
|
||||
data.lineHeight = parseInt(common.attributes.getNamedItem("lineHeight").nodeValue, 10);
|
||||
data.chars = {};
|
||||
|
||||
//parse letters
|
||||
var letters = this.ajaxRequest.responseXML.getElementsByTagName("char");
|
||||
|
||||
for (var i = 0; i < letters.length; i++)
|
||||
{
|
||||
var charCode = parseInt(letters[i].attributes.getNamedItem("id").nodeValue, 10);
|
||||
|
||||
var textureRect = {
|
||||
x: parseInt(letters[i].attributes.getNamedItem("x").nodeValue, 10),
|
||||
y: parseInt(letters[i].attributes.getNamedItem("y").nodeValue, 10),
|
||||
width: parseInt(letters[i].attributes.getNamedItem("width").nodeValue, 10),
|
||||
height: parseInt(letters[i].attributes.getNamedItem("height").nodeValue, 10)
|
||||
};
|
||||
PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect);
|
||||
|
||||
data.chars[charCode] = {
|
||||
xOffset: parseInt(letters[i].attributes.getNamedItem("xoffset").nodeValue, 10),
|
||||
yOffset: parseInt(letters[i].attributes.getNamedItem("yoffset").nodeValue, 10),
|
||||
xAdvance: parseInt(letters[i].attributes.getNamedItem("xadvance").nodeValue, 10),
|
||||
kerning: {}
|
||||
};
|
||||
}
|
||||
|
||||
//parse kernings
|
||||
var kernings = this.ajaxRequest.responseXML.getElementsByTagName("kerning");
|
||||
for (i = 0; i < kernings.length; i++)
|
||||
{
|
||||
var first = parseInt(kernings[i].attributes.getNamedItem("first").nodeValue, 10);
|
||||
var second = parseInt(kernings[i].attributes.getNamedItem("second").nodeValue, 10);
|
||||
var amount = parseInt(kernings[i].attributes.getNamedItem("amount").nodeValue, 10);
|
||||
|
||||
data.chars[second].kerning[first] = amount;
|
||||
|
||||
}
|
||||
PIXI.BitmapText.fonts[data.font] = data;
|
||||
|
||||
var scope = this;
|
||||
image.addEventListener("loaded", function() {
|
||||
scope.onLoaded();
|
||||
});
|
||||
image.load();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoked when all files are loaded (xml/fnt and texture)
|
||||
* @private
|
||||
*/
|
||||
PIXI.BitmapFontLoader.prototype.onLoaded = function()
|
||||
{
|
||||
this.dispatchEvent({type: "loaded", content: this});
|
||||
};
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
200
docs/files/src_pixi_loaders_ImageLoader.js.html
Normal file
200
docs/files/src_pixi_loaders_ImageLoader.js.html
Normal file
|
@ -0,0 +1,200 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/loaders/ImageLoader.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/loaders/ImageLoader.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
/**
|
||||
* The image loader class is responsible for loading images file formats ("jpeg", "jpg", "png" and "gif")
|
||||
* Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
|
||||
* When loaded this class will dispatch a 'loaded' event
|
||||
* @class ImageLoader
|
||||
* @extends EventTarget
|
||||
* @constructor
|
||||
* @param {String} url The url of the image
|
||||
* @param {Boolean} crossorigin
|
||||
*/
|
||||
PIXI.ImageLoader = function(url, crossorigin)
|
||||
{
|
||||
PIXI.EventTarget.call(this);
|
||||
this.texture = PIXI.Texture.fromImage(url, crossorigin);
|
||||
};
|
||||
|
||||
// constructor
|
||||
PIXI.ImageLoader.constructor = PIXI.ImageLoader;
|
||||
|
||||
/**
|
||||
* Loads image or takes it from cache
|
||||
*/
|
||||
PIXI.ImageLoader.prototype.load = function()
|
||||
{
|
||||
if(!this.texture.baseTexture.hasLoaded)
|
||||
{
|
||||
var scope = this;
|
||||
this.texture.baseTexture.addEventListener("loaded", function()
|
||||
{
|
||||
scope.onLoaded();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.onLoaded();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoked when image file is loaded or it is already cached and ready to use
|
||||
* @private
|
||||
*/
|
||||
PIXI.ImageLoader.prototype.onLoaded = function()
|
||||
{
|
||||
this.dispatchEvent({type: "loaded", content: this});
|
||||
};
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -130,30 +136,31 @@
|
|||
* The sprite sheet loader is used to load in JSON sprite sheet data
|
||||
* To generate the data you can use http://www.codeandweb.com/texturepacker and publish the "JSON" format
|
||||
* There is a free version so thats nice, although the paid version is great value for money.
|
||||
* It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
|
||||
* It is highly recommended to use Sprite sheets (also know as texture atlas") as it means sprite"s can be batched and drawn together for highly increased rendering speed.
|
||||
* Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
|
||||
* This loader will also load the image file that the Spritesheet points to as well as the data.
|
||||
* When loaded this class will dispatch a 'loaded' event
|
||||
* When loaded this class will dispatch a "loaded" event
|
||||
* @class SpriteSheetLoader
|
||||
* @extends EventTarget
|
||||
* @constructor
|
||||
* @param url {String} the url of the sprite sheet JSON file
|
||||
* @param {String} url the url of the sprite sheet JSON file
|
||||
* @param {Boolean} crossorigin
|
||||
*/
|
||||
|
||||
PIXI.SpriteSheetLoader = function(url)
|
||||
PIXI.SpriteSheetLoader = function(url, crossorigin)
|
||||
{
|
||||
/*
|
||||
* i use texture packer to load the assets..
|
||||
* http://www.codeandweb.com/texturepacker
|
||||
* make sure to set the format as "JSON"
|
||||
*/
|
||||
PIXI.EventTarget.call( this );
|
||||
PIXI.EventTarget.call(this);
|
||||
this.url = url;
|
||||
this.baseUrl = url.replace(/[^\/]*$/, '');
|
||||
this.texture;
|
||||
this.baseUrl = url.replace(/[^\/]*$/, "");
|
||||
this.texture = null;
|
||||
this.frames = {};
|
||||
this.crossorigin = false;
|
||||
}
|
||||
this.crossorigin = crossorigin;
|
||||
};
|
||||
|
||||
// constructor
|
||||
PIXI.SpriteSheetLoader.constructor = PIXI.SpriteSheetLoader;
|
||||
|
@ -165,32 +172,38 @@ PIXI.SpriteSheetLoader.prototype.load = function()
|
|||
{
|
||||
this.ajaxRequest = new AjaxRequest();
|
||||
var scope = this;
|
||||
this.ajaxRequest.onreadystatechange=function()
|
||||
this.ajaxRequest.onreadystatechange = function()
|
||||
{
|
||||
scope.onLoaded();
|
||||
}
|
||||
scope.onJSONLoaded();
|
||||
};
|
||||
|
||||
this.ajaxRequest.open("GET", this.url, true)
|
||||
this.ajaxRequest.open("GET", this.url, true);
|
||||
if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType("application/json");
|
||||
this.ajaxRequest.send(null)
|
||||
}
|
||||
};
|
||||
|
||||
PIXI.SpriteSheetLoader.prototype.onLoaded = function()
|
||||
/**
|
||||
* Invoke when JSON file is loaded
|
||||
* @private
|
||||
*/
|
||||
PIXI.SpriteSheetLoader.prototype.onJSONLoaded = function()
|
||||
{
|
||||
if (this.ajaxRequest.readyState==4)
|
||||
if (this.ajaxRequest.readyState == 4)
|
||||
{
|
||||
if (this.ajaxRequest.status==200 || window.location.href.indexOf("http")==-1)
|
||||
if (this.ajaxRequest.status == 200 || window.location.href.indexOf("http") == -1)
|
||||
{
|
||||
var jsondata = eval("("+this.ajaxRequest.responseText+")");
|
||||
|
||||
var textureUrl = this.baseUrl + jsondata.meta.image;
|
||||
|
||||
this.texture = PIXI.Texture.fromImage(textureUrl, this.crossorigin).baseTexture;
|
||||
|
||||
// if(!this.texture)this.texture = new PIXI.Texture(textureUrl);
|
||||
|
||||
var frameData = jsondata.frames;
|
||||
for (var i in frameData)
|
||||
var jsonData = eval("(" + this.ajaxRequest.responseText + ")");
|
||||
var textureUrl = this.baseUrl + jsonData.meta.image;
|
||||
|
||||
var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
|
||||
this.texture = image.texture.baseTexture;
|
||||
var scope = this;
|
||||
image.addEventListener("loaded", function(event) {
|
||||
scope.onLoaded();
|
||||
});
|
||||
|
||||
var frameData = jsonData.frames;
|
||||
for (var i in frameData)
|
||||
{
|
||||
var rect = frameData[i].frame;
|
||||
if (rect)
|
||||
|
@ -201,32 +214,24 @@ PIXI.SpriteSheetLoader.prototype.onLoaded = function()
|
|||
{
|
||||
//var realSize = frameData[i].spriteSourceSize;
|
||||
PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
|
||||
PIXI.TextureCache[i].trim.x = 0// (realSize.x / rect.w)
|
||||
PIXI.TextureCache[i].trim.x = 0;// (realSize.x / rect.w)
|
||||
// calculate the offset!
|
||||
}
|
||||
// this.frames[i] = ;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.texture.hasLoaded)
|
||||
{
|
||||
this.dispatchEvent( { type: 'loaded', content: this } );
|
||||
}
|
||||
else
|
||||
{
|
||||
var scope = this;
|
||||
// wait for the texture to load..
|
||||
this.texture.addEventListener('loaded', function(){
|
||||
|
||||
scope.dispatchEvent( { type: 'loaded', content: scope } );
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
image.load();
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Invoke when all files are loaded (json and texture)
|
||||
* @private
|
||||
*/
|
||||
PIXI.SpriteSheetLoader.prototype.onLoaded = function()
|
||||
{
|
||||
this.dispatchEvent({type: "loaded", content: this});
|
||||
};
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
306
docs/files/src_pixi_text_BitmapText.js.html
Normal file
306
docs/files/src_pixi_text_BitmapText.js.html
Normal file
|
@ -0,0 +1,306 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/text/BitmapText.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
|
||||
<script src="http://yui.yahooapis.com/combo?3.8.0/build/yui/yui-min.js"></script>
|
||||
</head>
|
||||
<body class="yui3-skin-sam">
|
||||
|
||||
<div id="doc">
|
||||
<div id="hd" class="yui3-g header">
|
||||
<div class="yui3-u-3-4">
|
||||
|
||||
<h1><img src="http://www.goodboydigital.com/pixijs/logo_small.png" title="Pixi.JS"></h1>
|
||||
|
||||
</div>
|
||||
<div class="yui3-u-1-4 version">
|
||||
<em>API Docs for: 1.0.0</em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bd" class="yui3-g">
|
||||
|
||||
<div class="yui3-u-1-4">
|
||||
<div id="docs-sidebar" class="sidebar apidocs">
|
||||
<div id="api-list">
|
||||
<h2 class="off-left">APIs</h2>
|
||||
<div id="api-tabview" class="tabview">
|
||||
<ul class="tabs">
|
||||
<li><a href="#api-classes">Classes</a></li>
|
||||
<li><a href="#api-modules">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="api-tabview-filter">
|
||||
<input type="search" id="api-filter" placeholder="Type to filter APIs">
|
||||
</div>
|
||||
|
||||
<div id="api-tabview-panel">
|
||||
<ul id="api-classes" class="apis classes">
|
||||
|
||||
<li><a href="../classes/AssetLoader.html">AssetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
||||
<li><a href="../classes/MovieClip.html">MovieClip</a></li>
|
||||
|
||||
<li><a href="../classes/Point.html">Point</a></li>
|
||||
|
||||
<li><a href="../classes/Rectangle.html">Rectangle</a></li>
|
||||
|
||||
<li><a href="../classes/Sprite.html">Sprite</a></li>
|
||||
|
||||
<li><a href="../classes/SpriteSheetLoader.html">SpriteSheetLoader</a></li>
|
||||
|
||||
<li><a href="../classes/Stage.html">Stage</a></li>
|
||||
|
||||
<li><a href="../classes/Text.html">Text</a></li>
|
||||
|
||||
<li><a href="../classes/Texture.html">Texture</a></li>
|
||||
|
||||
<li><a href="../classes/TilingSprite.html">TilingSprite</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLBatch.html">WebGLBatch</a></li>
|
||||
|
||||
<li><a href="../classes/WebGLRenderer.html">WebGLRenderer</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul id="api-modules" class="apis modules">
|
||||
|
||||
<li><a href="../modules/PIXI.html">PIXI</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="yui3-u-3-4">
|
||||
<div id="api-options">
|
||||
Show:
|
||||
<label for="api-show-inherited">
|
||||
<input type="checkbox" id="api-show-inherited" checked>
|
||||
Inherited
|
||||
</label>
|
||||
|
||||
<label for="api-show-protected">
|
||||
<input type="checkbox" id="api-show-protected">
|
||||
Protected
|
||||
</label>
|
||||
|
||||
<label for="api-show-private">
|
||||
<input type="checkbox" id="api-show-private">
|
||||
Private
|
||||
</label>
|
||||
<label for="api-show-deprecated">
|
||||
<input type="checkbox" id="api-show-deprecated">
|
||||
Deprecated
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/text/BitmapText.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
/**
|
||||
* @author Mat Groves http://matgroves.com/ @Doormat23
|
||||
*/
|
||||
|
||||
/**
|
||||
* A Text Object will create a line(s) of text using bitmap font
|
||||
* You can generate the fnt files using
|
||||
* http://www.angelcode.com/products/bmfont/ for windows of
|
||||
* http://www.bmglyph.com/ for mac.
|
||||
* @class BitmapText
|
||||
* @extends DisplayObjectContainer
|
||||
* @constructor
|
||||
* @param {String} text The copy that you would like the text to display
|
||||
* @param {Object} [style] The style parameters
|
||||
* @param {String} [style.font] default is "20pt Arial" The size and bitmap font id (must have loaded previously)
|
||||
* @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right")
|
||||
*/
|
||||
//* @param {Object} [style.font="bold 20pt Arial"] The style and size of the font
|
||||
PIXI.BitmapText = function(text, style)
|
||||
{
|
||||
PIXI.DisplayObjectContainer.call(this);
|
||||
|
||||
this.setText(text);
|
||||
this.setStyle(style);
|
||||
this.updateText();
|
||||
this.dirty = false
|
||||
|
||||
};
|
||||
|
||||
// constructor
|
||||
PIXI.BitmapText.constructor = PIXI.BitmapText;
|
||||
PIXI.BitmapText.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
|
||||
|
||||
/**
|
||||
* Set the copy for the text object
|
||||
* @methos setText
|
||||
* @param {String} text The copy that you would like the text to display
|
||||
*/
|
||||
PIXI.BitmapText.prototype.setText = function(text)
|
||||
{
|
||||
this.text = text || " ";
|
||||
this.dirty = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the style of the text
|
||||
* @method setStyle
|
||||
* @param {Object} [style] The style parameters
|
||||
* @param {Object} style.font The style and size of the font. If font size is not specified, it uses default bitmap font size. Font name is required
|
||||
* @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right")
|
||||
*/
|
||||
PIXI.BitmapText.prototype.setStyle = function(style)
|
||||
{
|
||||
style = style || {};
|
||||
style.align = style.align || "left";
|
||||
this.style = style;
|
||||
|
||||
var font = style.font.split(" ");
|
||||
this.fontName = font[font.length - 1];
|
||||
this.fontSize = font.length >= 2 ? parseInt(font[font.length - 2], 10) : PIXI.BitmapText.fonts[this.fontName].size;
|
||||
|
||||
this.dirty = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders text
|
||||
* @private
|
||||
*/
|
||||
PIXI.BitmapText.prototype.updateText = function()
|
||||
{
|
||||
var data = PIXI.BitmapText.fonts[this.fontName];
|
||||
var pos = new PIXI.Point();
|
||||
var prevCharCode = null;
|
||||
var chars = [];
|
||||
var maxLineWidth = 0;
|
||||
var lineWidths = [];
|
||||
var line = 0;
|
||||
var scale = this.fontSize / data.size;
|
||||
for(var i = 0; i < this.text.length; i++)
|
||||
{
|
||||
var charCode = this.text.charCodeAt(i);
|
||||
if(charCode == "\n".charCodeAt(0))
|
||||
{
|
||||
lineWidths.push(pos.x);
|
||||
maxLineWidth = Math.max(maxLineWidth, pos.x);
|
||||
line++;
|
||||
|
||||
pos.x = 0;
|
||||
pos.y += data.lineHeight;
|
||||
prevCharCode = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
var charData = data.chars[charCode];
|
||||
if(!charData) continue;
|
||||
|
||||
if(prevCharCode && charData[prevCharCode])
|
||||
{
|
||||
pos.x += charData.kerning[prevCharCode];
|
||||
}
|
||||
chars.push({line: line, charCode: charCode, position: new PIXI.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)});
|
||||
pos.x += charData.xAdvance;
|
||||
|
||||
prevCharCode = charCode;
|
||||
}
|
||||
|
||||
lineWidths.push(pos.x);
|
||||
maxLineWidth = Math.max(maxLineWidth, pos.x);
|
||||
|
||||
var lineAlignOffsets = [];
|
||||
for(i = 0; i <= line; i++)
|
||||
{
|
||||
var alignOffset = 0;
|
||||
if(this.style.align == "right")
|
||||
{
|
||||
alignOffset = maxLineWidth - lineWidths[i];
|
||||
}
|
||||
else if(this.style.align == "center")
|
||||
{
|
||||
alignOffset = (maxLineWidth - lineWidths[i]) / 2;
|
||||
}
|
||||
lineAlignOffsets.push(alignOffset);
|
||||
}
|
||||
|
||||
for(i = 0; i < chars.length; i++)
|
||||
{
|
||||
var char = PIXI.Sprite.fromFrame(chars[i].charCode);
|
||||
char.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
|
||||
char.position.y = chars[i].position.y * scale;
|
||||
char.scale.x = char.scale.y = scale;
|
||||
this.addChild(char);
|
||||
}
|
||||
|
||||
this.width = pos.x * scale;
|
||||
this.height = (pos.y + data.lineHeight) * scale;
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.BitmapText.prototype.updateTransform = function()
|
||||
{
|
||||
if(this.dirty)
|
||||
{
|
||||
while(this.children.length > 0)
|
||||
{
|
||||
this.removeChild(this.getChildAt(0));
|
||||
}
|
||||
this.updateText();
|
||||
|
||||
this.dirty = false;
|
||||
}
|
||||
|
||||
PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);
|
||||
};
|
||||
|
||||
PIXI.BitmapText.fonts = {};
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
||||
<script>prettyPrint();</script>
|
||||
<script src="../assets/js/yui-prettify.js"></script>
|
||||
<script src="../assets/../api.js"></script>
|
||||
<script src="../assets/js/api-filter.js"></script>
|
||||
<script src="../assets/js/api-list.js"></script>
|
||||
<script src="../assets/js/api-search.js"></script>
|
||||
<script src="../assets/js/apidocs.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>src/pixi/Text.js - Pixi.JS</title>
|
||||
<title>src/pixi/text/Text.js - Pixi.JS</title>
|
||||
<link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0/build/cssgrids/cssgrids-min.css">
|
||||
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
||||
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
||||
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -118,7 +124,7 @@
|
|||
<div class="apidocs">
|
||||
<div id="docs-main">
|
||||
<div class="content">
|
||||
<h1 class="file-heading">File: src/pixi/Text.js</h1>
|
||||
<h1 class="file-heading">File: src/pixi/text/Text.js</h1>
|
||||
|
||||
<div class="file">
|
||||
<pre class="code prettyprint linenums">
|
||||
|
@ -127,110 +133,156 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* A Text Object will create a line of text
|
||||
* A Text Object will create a line(s) of text to split a line you can use "\n"
|
||||
* @class Text
|
||||
* @extends Sprite
|
||||
* @constructor
|
||||
* @param text {String} The copy that you would like the text to display
|
||||
* @param fontStyle {String} the style and size of the font eg "bold 20px Arial"
|
||||
* @param fillStyle {Object} a canvas fillstyle that will be used on the text eg "red", "#00FF00" can also be null
|
||||
* @param strokeStyle {String} a canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" can also be null
|
||||
* @param strokeThickness {Number} A number that represents the thicknes of the stroke. default is 0 (no stroke)
|
||||
* @param {String} text The copy that you would like the text to display
|
||||
* @param {Object} [style] The style parameters
|
||||
* @param {String} [style.font] default "bold 20pt Arial" The style and size of the font
|
||||
* @param {Object} [style.fill="black"] A canvas fillstyle that will be used on the text eg "red", "#00FF00"
|
||||
* @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right")
|
||||
* @param {String} [style.stroke] A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00"
|
||||
* @param {Number} [style.strokeThickness=0] A number that represents the thickness of the stroke. Default is 0 (no stroke)
|
||||
*/
|
||||
PIXI.Text = function(text, fontStyle, fillStyle, strokeStyle, strokeThickness)
|
||||
PIXI.Text = function(text, style)
|
||||
{
|
||||
this.canvas = document.createElement("canvas");
|
||||
|
||||
this.context = this.canvas.getContext("2d");
|
||||
//document.body.appendChild(this.canvas);
|
||||
this.setText(text);
|
||||
this.setStyle(fontStyle, fillStyle, strokeStyle, strokeThickness);
|
||||
|
||||
this.updateText();
|
||||
|
||||
PIXI.Sprite.call( this, PIXI.Texture.fromCanvas(this.canvas));
|
||||
|
||||
// need to store a canvas that can
|
||||
}
|
||||
this.canvas = document.createElement("canvas");
|
||||
this.context = this.canvas.getContext("2d");
|
||||
PIXI.Sprite.call(this, PIXI.Texture.fromCanvas(this.canvas));
|
||||
|
||||
this.setText(text);
|
||||
this.setStyle(style);
|
||||
this.updateText();
|
||||
this.dirty = false;
|
||||
};
|
||||
|
||||
// constructor
|
||||
PIXI.Text.constructor = PIXI.Text;
|
||||
PIXI.Text.prototype = Object.create( PIXI.Sprite.prototype );
|
||||
|
||||
/**
|
||||
* Set the copy for the text object
|
||||
* @methos setText
|
||||
* @param text {String} The copy that you would like the text to display
|
||||
*/
|
||||
PIXI.Text.prototype.setText = function(text)
|
||||
{
|
||||
this.text = text || " ";
|
||||
this.dirty = true;
|
||||
}
|
||||
PIXI.Text.prototype = Object.create(PIXI.Sprite.prototype);
|
||||
|
||||
/**
|
||||
* Set the style of the text
|
||||
* @method setStyle
|
||||
* @constructor
|
||||
* @param fontStyle {String} the style and size of the font eg "bold 20px Arial"
|
||||
* @param fillStyle {Object} a canvas fillstyle that will be used on the text eg "red", "#00FF00" can also be null
|
||||
* @param strokeStyle {String} a canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00" can also be null
|
||||
* @param strokeThickness {Number} A number that represents the thicknes of the stroke. default is 0 (no stroke)
|
||||
* @param {Object} [style] The style parameters
|
||||
* @param {String} [style.font="bold 20pt Arial"] The style and size of the font
|
||||
* @param {Object} [style.fill="black"] A canvas fillstyle that will be used on the text eg "red", "#00FF00"
|
||||
* @param {String} [style.align="left"] An alignment of the multiline text ("left", "center" or "right")
|
||||
* @param {String} [style.stroke] A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00"
|
||||
* @param {Number} [style.strokeThickness=0] A number that represents the thickness of the stroke. Default is 0 (no stroke)
|
||||
*/
|
||||
PIXI.Text.prototype.setStyle = function(fontStyle, fillStyle, strokeStyle, strokeThickness)
|
||||
PIXI.Text.prototype.setStyle = function(style)
|
||||
{
|
||||
this.fontStyle = fontStyle || "bold 20pt Arial";
|
||||
this.fillStyle = fillStyle;
|
||||
this.strokeStyle = strokeStyle;
|
||||
this.strokeThickness = strokeThickness || 0;
|
||||
|
||||
this.dirty = true;
|
||||
}
|
||||
style = style || {};
|
||||
style.font = style.font || "bold 20pt Arial";
|
||||
style.fill = style.fill || "black";
|
||||
style.align = style.align || "left";
|
||||
style.strokeThickness = style.strokeThickness || 0;
|
||||
this.style = style;
|
||||
this.dirty = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the copy for the text object. To split a line you can use "\n"
|
||||
* @methos setText
|
||||
* @param {String} text The copy that you would like the text to display
|
||||
*/
|
||||
PIXI.Sprite.prototype.setText = function(text)
|
||||
{
|
||||
this.text = text || " ";
|
||||
this.dirty = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders text
|
||||
* @private
|
||||
*/
|
||||
PIXI.Text.prototype.updateText = function()
|
||||
{
|
||||
// console.log(this.text);
|
||||
this.context.font = this.fontStyle;
|
||||
|
||||
this.canvas.width = this.context.measureText(this.text).width + this.strokeThickness//textDimensions.width;
|
||||
this.canvas.height = this.determineFontHeight("font: " + this.fontStyle + ";")+ this.strokeThickness;// textDimensions.height;
|
||||
this.context.font = this.style.font;
|
||||
|
||||
this.context.fillStyle = this.fillStyle;
|
||||
this.context.font = this.fontStyle;
|
||||
//split text into lines
|
||||
var lines = this.text.split("\n");
|
||||
|
||||
//calculate text width
|
||||
var lineWidths = [];
|
||||
var maxLineWidth = 0;
|
||||
for (var i = 0; i < lines.length; i++)
|
||||
{
|
||||
var lineWidth = this.context.measureText(lines[i]).width;
|
||||
lineWidths[i] = lineWidth;
|
||||
maxLineWidth = Math.max(maxLineWidth, lineWidth);
|
||||
}
|
||||
this.canvas.width = maxLineWidth + this.style.strokeThickness;
|
||||
|
||||
this.context.strokeStyle = this.strokeStyle;
|
||||
this.context.lineWidth = this.strokeThickness;
|
||||
//calculate text height
|
||||
var lineHeight = this.determineFontHeight("font: " + this.style.font + ";") + this.style.strokeThickness;
|
||||
this.canvas.height = lineHeight * lines.length;
|
||||
|
||||
this.context.textBaseline="top";
|
||||
|
||||
if(this.strokeStyle && this.strokeThickness)this.context.strokeText(this.text, this.strokeThickness/2, this.strokeThickness/2);
|
||||
if(this.fillStyle)this.context.fillText(this.text, this.strokeThickness/2, this.strokeThickness/2);
|
||||
//set canvas text styles
|
||||
this.context.fillStyle = this.style.fill;
|
||||
this.context.font = this.style.font;
|
||||
|
||||
|
||||
// console.log("//")
|
||||
}
|
||||
this.context.strokeStyle = this.style.stroke;
|
||||
this.context.lineWidth = this.style.strokeThickness;
|
||||
|
||||
this.context.textBaseline = "top";
|
||||
|
||||
//draw lines line by line
|
||||
for (i = 0; i < lines.length; i++)
|
||||
{
|
||||
var linePosition = new PIXI.Point(this.style.strokeThickness / 2, this.style.strokeThickness / 2 + i * lineHeight);
|
||||
|
||||
if(this.style.align == "right")
|
||||
{
|
||||
linePosition.x += maxLineWidth - lineWidths[i];
|
||||
}
|
||||
else if(this.style.align == "center")
|
||||
{
|
||||
linePosition.x += (maxLineWidth - lineWidths[i]) / 2;
|
||||
}
|
||||
|
||||
if(this.style.stroke && this.style.strokeThickness)
|
||||
{
|
||||
this.context.strokeText(lines[i], linePosition.x, linePosition.y);
|
||||
}
|
||||
|
||||
if(this.style.fill)
|
||||
{
|
||||
this.context.fillText(lines[i], linePosition.x, linePosition.y);
|
||||
}
|
||||
}
|
||||
|
||||
this.updateTexture();
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates texture size based on canvas size
|
||||
* @private
|
||||
*/
|
||||
PIXI.Text.prototype.updateTexture = function()
|
||||
{
|
||||
|
||||
this.texture.baseTexture.width = this.canvas.width;
|
||||
this.texture.baseTexture.height = this.canvas.height;
|
||||
this.texture.frame.width = this.canvas.width;
|
||||
this.texture.frame.height = this.canvas.height;
|
||||
PIXI.texturesToUpdate.push(this.texture.baseTexture);
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
PIXI.Text.prototype.updateTransform = function()
|
||||
{
|
||||
if(this.dirty)
|
||||
{
|
||||
this.updateText();
|
||||
|
||||
// update the texture..
|
||||
this.texture.baseTexture.width = this.canvas.width;
|
||||
this.texture.baseTexture.height = this.canvas.height;
|
||||
this.texture.frame.width = this.canvas.width;
|
||||
this.texture.frame.height = this.canvas.height;
|
||||
|
||||
PIXI.texturesToUpdate.push(this.texture.baseTexture);
|
||||
this.dirty = false;
|
||||
}
|
||||
|
||||
PIXI.Sprite.prototype.updateTransform.call( this );
|
||||
}
|
||||
PIXI.Sprite.prototype.updateTransform.call(this);
|
||||
};
|
||||
|
||||
/*
|
||||
* http://stackoverflow.com/users/34441/ellisbben
|
||||
|
@ -238,9 +290,9 @@ PIXI.Text.prototype.updateTransform = function()
|
|||
*/
|
||||
PIXI.Text.prototype.determineFontHeight = function(fontStyle)
|
||||
{
|
||||
// build a little refference dictionary so if the font style has been used return a
|
||||
// build a little reference dictionary so if the font style has been used return a
|
||||
// cached version...
|
||||
var result = PIXI.Text.heightCache[fontStyle]
|
||||
var result = PIXI.Text.heightCache[fontStyle];
|
||||
|
||||
if(!result)
|
||||
{
|
||||
|
@ -252,7 +304,7 @@ PIXI.Text.prototype.determineFontHeight = function(fontStyle)
|
|||
body.appendChild(dummy);
|
||||
|
||||
result = dummy.offsetHeight;
|
||||
PIXI.Text.heightCache[fontStyle] = result
|
||||
PIXI.Text.heightCache[fontStyle] = result;
|
||||
|
||||
body.removeChild(dummy);
|
||||
}
|
||||
|
@ -267,7 +319,7 @@ PIXI.Text.prototype.destroy = function(destroyTexture)
|
|||
this.texture.destroy();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
PIXI.Text.heightCache = {};
|
||||
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="./classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="./classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="./classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="./classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="./classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="./classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="./classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="./classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="./classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
|
|
@ -45,12 +45,18 @@
|
|||
|
||||
<li><a href="../classes/BaseTexture.html">BaseTexture</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapFontLoader.html">BitmapFontLoader</a></li>
|
||||
|
||||
<li><a href="../classes/BitmapText.html">BitmapText</a></li>
|
||||
|
||||
<li><a href="../classes/CanvasRenderer.html">CanvasRenderer</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
|
||||
|
||||
<li><a href="../classes/DisplayObjectContainer.html">DisplayObjectContainer</a></li>
|
||||
|
||||
<li><a href="../classes/ImageLoader.html">ImageLoader</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionData.html">InteractionData</a></li>
|
||||
|
||||
<li><a href="../classes/InteractionManager.html">InteractionManager</a></li>
|
||||
|
@ -126,7 +132,7 @@
|
|||
|
||||
|
||||
<div class="foundat">
|
||||
Defined in: <a href="../files/src_pixi_Text.js.html#l5"><code>src/pixi/Text.js:5</code></a>
|
||||
Defined in: <a href="../files/src_pixi_Stage.js.html#l5"><code>src/pixi/Stage.js:5</code></a>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -160,6 +166,18 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/BitmapFontLoader.html">
|
||||
BitmapFontLoader
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/BitmapText.html">
|
||||
BitmapText
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/CanvasRenderer.html">
|
||||
CanvasRenderer
|
||||
|
@ -178,6 +196,12 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/ImageLoader.html">
|
||||
ImageLoader
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="module-class">
|
||||
<a href="../classes/InteractionData.html">
|
||||
InteractionData
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue